tghamm / Anthropic.SDK

An unofficial C#/.NET SDK for accessing the Anthropic Claude API
https://www.nuget.org/packages/Anthropic.SDK
MIT License
55 stars 10 forks source link

[Feature request] Proxy support #18

Closed GilbertoTheMighty closed 4 months ago

GilbertoTheMighty commented 5 months ago

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);
tghamm commented 5 months ago

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

gluip commented 5 months ago

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

tghamm commented 4 months ago

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.