Created
October 1, 2015 23:41
-
-
Save niemyjski/39f7e67ce5edc652ec62 to your computer and use it in GitHub Desktop.
Setting Exceptionless proxy settings during runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Override the default submission client | |
public class ProxySubmissionClient : SubmissionClient { | |
protected override HttpWebRequest CreateHttpWebRequest(ExceptionlessConfiguration config, string endPoint) { | |
var request = base.CreateHttpWebRequest(config, endPoint); | |
// Set the proxy info here. | |
try { | |
request.Proxy = new WebProxy("MyProxyAddress"); | |
} catch (Exception) {} | |
return request; | |
} | |
} | |
// After the the startup/register call register the new submission client with the dependency injection. | |
ExceptionlessClient.Default.Startup(); | |
ExceptionlessClient.Configuration.Resolver.Register<ISubmissionClient, ProxySubmissionClient>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment