Skip to content

Instantly share code, notes, and snippets.

@niemyjski
Created October 1, 2015 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niemyjski/39f7e67ce5edc652ec62 to your computer and use it in GitHub Desktop.
Save niemyjski/39f7e67ce5edc652ec62 to your computer and use it in GitHub Desktop.
Setting Exceptionless proxy settings during runtime
// 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