I\'m troubleshooting a bug with a service I call through .NET\'s HttpClient, trying to route the request through a local proxy (Fiddler), but my proxy settings seem to not b
This code worked for me:
var httpClientHandler = new HttpClientHandler
{
Proxy = new WebProxy("http://localhost:8888", false),
UseProxy = true
}
Note that I am not supplying an empty array to my WebProxy
constructor. Perhaps that's the problem?
Ah, The BaseAddress I was pointing to was http://localhost:8081
. Turns out that despite setting BypassOnLocal to false, evidently localhost is still special enough that it bypasses the proxy.
I added a domain binding in IIS, host file entry to point that domain to 127.0.0.1, used newly created domain, now it works.
Is Fiddler configured to capture traffic from all processes? Look at the status bar where you see "Capturing". It should show "All Processes" next to it. If it shows "Web browsers", click it and change it to all processes. This could be different depending on the version of Fiddler you use.