I set up a proxy through Windows settings (Internet Options) (proxy type is pac)
All Browsers work well with proxies (so proxy is active and working), but when I try to use httpclient, I get the following error
SocketException: An existing connection was forcibly closed by the remote host.
this is my codes
using (HttpClient client = new HttpClient())
{
using (HttpResponseMessage response = await client.GetAsync(url))
{
using (HttpContent content = response.Content)
{
return await content.ReadAsStringAsync();
}
}
}
How can I use a proxy set on Windows in my app?