Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set default proxy with .NET core 3.1 for HTTP client for any request?

I am using interfax.api dll to send faxes to users. how I can add proxy server configurations to send the fax to users. actually I want to enable proxy server settings in .net core. what is best way to do it?

like image 891
Ali Hussain Avatar asked Oct 20 '25 17:10

Ali Hussain


1 Answers

the issue not seems to be with interfax api. this can be solved with adding proxy uri to your .net core project like that

HttpClient.DefaultProxy = new WebProxy("http://199.169.6.177:5589/", true);

in your startup class ConfigureServices method

like image 109
Ali Hussain Avatar answered Oct 23 '25 09:10

Ali Hussain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!