tghamm/Anthropic.SDK

[Feature request] Proxy support

Closed this issue · 3 comments

Hello. Could you please add proxy support to this api.

var handler = new HttpClientHandler
{
    Proxy = new WebProxy
    {
        Address = new Uri("socks5://8.8.8.8:123"),
        Credentials = new NetworkCredential("user", "pass")
    }
};

client = new HttpClient(handler);

Yeah I think that can be supported, will try and work on it in the next couple of days.

@GilbertoTheMighty You can use the HttpClientHandlerFactory for that. Just inject it into the AnthropicClient instance.

Following in a few other libraries footsteps, I switched to HttpClient (and removed a dep in the process) so this can be a little more targeted now than with a Factory.