Proxy?
iMaxopoly opened this issue · 2 comments
iMaxopoly commented
Hi,
I'm actually learning c# and while trying to use this library I wanted to pass proxy into the handler, can I not do that?
Kindly guide me as to how I can pass proxy to the handler.
Thank you.
elcattivo commented
The ClearanceHandler
is just a layer between the HttpClient and (in most cases) a HttpClientHandler. If you want to use a proxy, you just have to set the HttpClientHandler
's properties accordingly.
var proxy = new WebProxy("http://proxy-adress.tld:8080");
var client = new HttpClient(new ClearanceHandler(new HttpClientHandler
{
Proxy = proxy,
UseProxy = true
}));
Deleted user commented
Thanks !