fix: 代理ip使用重构为统一方法

This commit is contained in:
shaw
2025-08-20 23:21:32 +08:00
parent a45c832278
commit cb29b3f7e4
10 changed files with 161 additions and 13 deletions

View File

@@ -502,10 +502,17 @@ class ClaudeRelayService {
const account = accountData.find((acc) => acc.id === accountId)
if (!account || !account.proxy) {
logger.debug('🌐 No proxy configured for Claude account')
return null
}
return ProxyHelper.createProxyAgent(account.proxy)
const proxyAgent = ProxyHelper.createProxyAgent(account.proxy)
if (proxyAgent) {
logger.info(
`🌐 Using proxy for Claude request: ${ProxyHelper.getProxyDescription(account.proxy)}`
)
}
return proxyAgent
} catch (error) {
logger.warn('⚠️ Failed to create proxy agent:', error)
return null