fix: use of proxy, use undici

This commit is contained in:
Danny Avila 2025-04-13 15:55:22 -04:00
parent a326c18b74
commit 83153cd582
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
5 changed files with 20 additions and 7 deletions

View file

@ -1,5 +1,5 @@
const { ProxyAgent } = require('undici');
const Anthropic = require('@anthropic-ai/sdk');
const { HttpsProxyAgent } = require('https-proxy-agent');
const {
Constants,
ErrorTypes,
@ -193,7 +193,7 @@ class AnthropicClient extends BaseClient {
};
if (this.options.proxy) {
options.httpAgent = new HttpsProxyAgent(this.options.proxy);
options.httpAgent = new ProxyAgent(this.options.proxy);
}
if (this.options.reverseProxyUrl) {