How to configure HttpClient to use Default System Proxy
John0King opened this issue · comments
Some details
In this doc https://microsoft.github.io/reverse-proxy/articles/http-client-config.html#httpclient is shows a way to configure a WebProxy, but not mention how to just set the HttpClientHandler.UseProxy
to true
,
I use a custom configuration to set it to use system proxy for fiddler debugging
.ConfigureHttpClient((c, h) =>
{
h.UseProxy = true;
})
and I hope I can use the build in configuration for that
This seems like something we could call out in the docs - The default ForwarderHttpClientFactory
will set UseProxy
to false, so if you want to use the default proxy (not a manually specified one from the config), you can flip it back to true
.
Another similar case with fiddler: #1477 (comment)
I don't remember actually discussing why the default of disabling UseProxy
was chosen though.