Skip to content

Instantly share code, notes, and snippets.

@shiftkey
Created March 27, 2013 08:55
Show Gist options
  • Save shiftkey/5252788 to your computer and use it in GitHub Desktop.
Save shiftkey/5252788 to your computer and use it in GitHub Desktop.
Set a proxy on HttpClient
var proxy = new WebProxy {Address = new Uri("http://someurl/")};
var handler = new WebRequestHandler {Proxy = proxy};
var client = new HttpClient(handler);
client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://otherurl/"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment