Using a proxy with .NET 4.5 HttpClient

This code worked for me:

using System.Net;
using System.Net.Http;

var httpClientHandler = new HttpClientHandler
{
    Proxy    = new WebProxy(Address: "http://localhost:8888", BypassOnLocal: false),
    UseProxy = true
}

Note that I am not using the WebProxy constructor overload that accepts string\[\] bypassList, but your code does – perhaps that’s the problem?

Leave a Comment