diff --git a/Backtrace/Backtrace.csproj b/Backtrace/Backtrace.csproj index e3bce2e..ddf0e22 100644 --- a/Backtrace/Backtrace.csproj +++ b/Backtrace/Backtrace.csproj @@ -4,7 +4,7 @@ netstandard2.0;net45;net35 true Backtrace Error Diagnostic Tools Debug Bug Bugs StackTrace - 2.1.0 + 2.1.1 Backtrace https://github.com/backtrace-labs/backtrace-csharp/blob/master/LICENSE https://github.com/backtrace-labs/backtrace-csharp @@ -12,12 +12,12 @@ Backtrace's integration with C# applications allows customers to capture and report handled and unhandled C# exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors. https://github.com/backtrace-labs/backtrace-csharp en - 2.1.0 + 2.1.1 Backtrace I/O Backtrace I/O Backtrace I/O - 2.1.0.0 - 2.1.0.0 + 2.1.1.0 + 2.1.1.0 diff --git a/Backtrace/Model/BacktraceCredentials.cs b/Backtrace/Model/BacktraceCredentials.cs index 4c6ddbd..2f6643d 100644 --- a/Backtrace/Model/BacktraceCredentials.cs +++ b/Backtrace/Model/BacktraceCredentials.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Specialized; using System.Configuration; +using System.Net; using System.Text; namespace Backtrace.Model @@ -38,6 +39,10 @@ internal string Token } } +#if !NET35 + public WebProxy Proxy { get; set; } = null; +#endif + /// /// Create submission url to Backtrace API /// @@ -63,7 +68,7 @@ internal Uri GetSubmissionUrl() { uriBuilder.Scheme = $"https://{uriBuilder.Scheme}"; } - if(!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path)) + if (!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path)) { uriBuilder.Path += "/"; } diff --git a/Backtrace/Services/BacktraceApi.cs b/Backtrace/Services/BacktraceApi.cs index f90cf10..4989f7b 100644 --- a/Backtrace/Services/BacktraceApi.cs +++ b/Backtrace/Services/BacktraceApi.cs @@ -54,6 +54,9 @@ public BacktraceApi(BacktraceCredentials credentials, uint reportPerMin = 3) } _serverurl = credentials.GetSubmissionUrl(); reportLimitWatcher = new ReportLimitWatcher(reportPerMin); +#if !NET35 + InitializeHttpClient(credentials.Proxy); +#endif } #region asyncRequest #if !NET35 @@ -61,7 +64,18 @@ public BacktraceApi(BacktraceCredentials credentials, uint reportPerMin = 3) /// /// The http client. /// - internal HttpClient HttpClient = new HttpClient(); + internal HttpClient HttpClient; + private void InitializeHttpClient(WebProxy proxy) + { + if (proxy != null) + { + HttpClient = new HttpClient(new HttpClientHandler() { Proxy = proxy }, true); + } + else + { + HttpClient = new HttpClient(); + } + } public async Task SendAsync(BacktraceData data) { diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a4bf0b..2fedb52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Backtrace C# Release Notes +## Version 2.1.1 - 18.03.2019 +- `BacktraceCredentials` allows you to pass `WebProxy` object to `Proxy` property. `BacktraceApi` will use proxy object to create `HttpClient` ## Version 2.1.0 - 10.03.2019 diff --git a/README.md b/README.md index 02f13f7..5fce57c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Backtrace -[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.0-blue.svg)](https://www.nuget.org/packages/Backtrace) +[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace) [![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp) -[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace) +[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.2-blue.svg)](https://www.nuget.org/packages/Backtrace) [![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu/branch/dev?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp/branch/dev) @@ -191,6 +191,7 @@ For more information on `BacktraceClientConfiguration` parameters please see