mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 修复create_proxyagent调用方式
This commit is contained in:
@@ -449,9 +449,8 @@ async function handleMessages(req, res) {
|
|||||||
|
|
||||||
// 添加代理配置
|
// 添加代理配置
|
||||||
if (proxyConfig) {
|
if (proxyConfig) {
|
||||||
const proxyHelper = new ProxyHelper()
|
axiosConfig.httpsAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpsAgent = proxyHelper.createProxyAgent(proxyConfig)
|
axiosConfig.httpAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpAgent = proxyHelper.createProxyAgent(proxyConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -732,9 +731,8 @@ async function handleModels(req, res) {
|
|||||||
headers: { 'Content-Type': 'application/json' }
|
headers: { 'Content-Type': 'application/json' }
|
||||||
}
|
}
|
||||||
if (proxyConfig) {
|
if (proxyConfig) {
|
||||||
const proxyHelper = new ProxyHelper()
|
axiosConfig.httpsAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpsAgent = proxyHelper.createProxyAgent(proxyConfig)
|
axiosConfig.httpAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpAgent = proxyHelper.createProxyAgent(proxyConfig)
|
|
||||||
}
|
}
|
||||||
const response = await axios(axiosConfig)
|
const response = await axios(axiosConfig)
|
||||||
models = (response.data.models || []).map((m) => ({
|
models = (response.data.models || []).map((m) => ({
|
||||||
@@ -1234,9 +1232,8 @@ async function handleCountTokens(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (proxyConfig) {
|
if (proxyConfig) {
|
||||||
const proxyHelper = new ProxyHelper()
|
axiosConfig.httpsAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpsAgent = proxyHelper.createProxyAgent(proxyConfig)
|
axiosConfig.httpAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpAgent = proxyHelper.createProxyAgent(proxyConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1963,9 +1960,8 @@ async function handleStandardGenerateContent(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (proxyConfig) {
|
if (proxyConfig) {
|
||||||
const proxyHelper = new ProxyHelper()
|
axiosConfig.httpsAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpsAgent = proxyHelper.createProxyAgent(proxyConfig)
|
axiosConfig.httpAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpAgent = proxyHelper.createProxyAgent(proxyConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -2246,9 +2242,8 @@ async function handleStandardStreamGenerateContent(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (proxyConfig) {
|
if (proxyConfig) {
|
||||||
const proxyHelper = new ProxyHelper()
|
axiosConfig.httpsAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpsAgent = proxyHelper.createProxyAgent(proxyConfig)
|
axiosConfig.httpAgent = ProxyHelper.createProxyAgent(proxyConfig)
|
||||||
axiosConfig.httpAgent = proxyHelper.createProxyAgent(proxyConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user