generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

Can support custom httpproxy?

Open DummyAppTest opened this issue 1 year ago • 2 comments

Can support custom httpproxy?

DummyAppTest avatar Oct 14 '24 07:10 DummyAppTest

Hello @DummyAppTest

Thanks for the question. Not yet. I'm using SocketsHttpHandler in .NET compared to the HttpClientHandler in .NET Framework.

I'll add this to the roadmap.

Cheers, JoKi

jochenkirstaetter avatar Oct 14 '24 07:10 jochenkirstaetter

Hello @DummyAppTest

After looking further into this. I found that the SocketsHttpHandler could use a proxy by default. See here: https://github.com/dotnet/runtime/blob/6221ddb3051463309801c9008f332b34361da798/src/libraries/Common/src/System/Net/Http/HttpHandlerDefaults.cs#L24

The current implementation of the SDK does not set any value, hence the default behaviour applies. You should be able to specify proxy settings using the default mechanism to read proxy information from the settings file.

Anyway, I'll keep this on my roadmap, and see how a Proxy property could be exposed publicly.

Cheers, JoKi

jochenkirstaetter avatar Oct 14 '24 07:10 jochenkirstaetter

Hi @DummyAppTest

A Proxy property as well as an IWebProxy parameter for the constructor has been exposed. This shall allow to specify a custom proxy to use with the SDK.

See also PR #102 for the code changes.

Cheers

jochenkirstaetter avatar Aug 20 '25 21:08 jochenkirstaetter

Hello @DummyAppTest

This has been published in release v2.8.0

Cheers

jochenkirstaetter avatar Aug 25 '25 17:08 jochenkirstaetter