Skip to content

Commit dc6f2f6

Browse files
authored
Version 2.1.1 (#23)
added web proxy property to BacktraceCredential object
1 parent 675c92d commit dc6f2f6

5 files changed

Lines changed: 30 additions & 8 deletions

File tree

Backtrace/Backtrace.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
<TargetFrameworks>netstandard2.0;net45;net35</TargetFrameworks>
55
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
66
<PackageTags>Backtrace Error Diagnostic Tools Debug Bug Bugs StackTrace</PackageTags>
7-
<PackageVersion>2.1.0</PackageVersion>
7+
<PackageVersion>2.1.1</PackageVersion>
88
<Product>Backtrace</Product>
99
<PackageLicenseUrl>https://github.com/backtrace-labs/backtrace-csharp/blob/master/LICENSE</PackageLicenseUrl>
1010
<PackageProjectUrl>https://github.com/backtrace-labs/backtrace-csharp</PackageProjectUrl>
1111
<PackageIconUrl>http://backtrace.io/images/icon.png</PackageIconUrl>
1212
<Description>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.</Description>
1313
<RepositoryUrl>https://github.com/backtrace-labs/backtrace-csharp</RepositoryUrl>
1414
<NeutralLanguage>en</NeutralLanguage>
15-
<Version>2.1.0</Version>
15+
<Version>2.1.1</Version>
1616
<Copyright>Backtrace I/O</Copyright>
1717
<Authors>Backtrace I/O</Authors>
1818
<Company>Backtrace I/O</Company>
19-
<AssemblyVersion>2.1.0.0</AssemblyVersion>
20-
<FileVersion>2.1.0.0</FileVersion>
19+
<AssemblyVersion>2.1.1.0</AssemblyVersion>
20+
<FileVersion>2.1.1.0</FileVersion>
2121
</PropertyGroup>
2222

2323
<ItemGroup>

Backtrace/Model/BacktraceCredentials.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Specialized;
33
using System.Configuration;
4+
using System.Net;
45
using System.Text;
56

67
namespace Backtrace.Model
@@ -38,6 +39,10 @@ internal string Token
3839
}
3940
}
4041

42+
#if !NET35
43+
public WebProxy Proxy { get; set; } = null;
44+
#endif
45+
4146
/// <summary>
4247
/// Create submission url to Backtrace API
4348
/// </summary>
@@ -63,7 +68,7 @@ internal Uri GetSubmissionUrl()
6368
{
6469
uriBuilder.Scheme = $"https://{uriBuilder.Scheme}";
6570
}
66-
if(!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path))
71+
if (!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path))
6772
{
6873
uriBuilder.Path += "/";
6974
}

Backtrace/Services/BacktraceApi.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,28 @@ public BacktraceApi(BacktraceCredentials credentials, uint reportPerMin = 3)
5454
}
5555
_serverurl = credentials.GetSubmissionUrl();
5656
reportLimitWatcher = new ReportLimitWatcher(reportPerMin);
57+
#if !NET35
58+
InitializeHttpClient(credentials.Proxy);
59+
#endif
5760
}
5861
#region asyncRequest
5962
#if !NET35
6063

6164
/// <summary>
6265
/// The http client.
6366
/// </summary>
64-
internal HttpClient HttpClient = new HttpClient();
67+
internal HttpClient HttpClient;
68+
private void InitializeHttpClient(WebProxy proxy)
69+
{
70+
if (proxy != null)
71+
{
72+
HttpClient = new HttpClient(new HttpClientHandler() { Proxy = proxy }, true);
73+
}
74+
else
75+
{
76+
HttpClient = new HttpClient();
77+
}
78+
}
6579

6680
public async Task<BacktraceResult> SendAsync(BacktraceData data)
6781
{

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Backtrace C# Release Notes
22

3+
## Version 2.1.1 - 18.03.2019
4+
- `BacktraceCredentials` allows you to pass `WebProxy` object to `Proxy` property. `BacktraceApi` will use proxy object to create `HttpClient`
35

46
## Version 2.1.0 - 10.03.2019
57

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Backtrace
2-
[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.0-blue.svg)](https://www.nuget.org/packages/Backtrace)
2+
[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace)
33
[![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp)
44

5-
[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace)
5+
[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.2-blue.svg)](https://www.nuget.org/packages/Backtrace)
66
[![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu/branch/dev?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp/branch/dev)
77

88

@@ -191,6 +191,7 @@ For more information on `BacktraceClientConfiguration` parameters please see <a
191191

192192
Notes:
193193
- If parameter `reportPerMin` is equal to 0, there is no limit on the number of error reports per minute. When the `reportPerMin` cap is reached, `BacktraceClient.Send/BacktraceClient.SendAsync` method will return false,
194+
- If you develop application behind the proxy you can pass `WebProxy` object to `BacktraceCredentials` object. We will try to use `WebProxy` object when user pass it to `Backtrace`. To setup proxy use property `Proxy`,
194195
- `BacktraceClient` allows you to unpack `AggregateExceptions` and send only exceptions that are available in `InnerException` property of `AggregateException`. By default `BacktraceClient` will send `AggregateException` information to Backtrace server. To avoid sending these reports, please override `UnpackAggregateException` and set value to `true`.
195196

196197

0 commit comments

Comments
 (0)