I am migrating the asp.net web application to asp.net core 6.0. For handling inbound proxies i have followed the following Microsoft link;
Is there any link or guideline for managing outbound proxy?
I have tried this so far but not sure if this is a right way of managing outbound proxy.
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient("SampleClient", client =>
{
client.BaseAddress = new Uri("https://sample.client.url.com");
})
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
{
Proxy = new WebProxy("https://sample.proxy.url.com")
});
}