现在官方会对ip地址进行限速,所以增加代理服务器功能

This commit is contained in:
1e0n
2025-10-24 12:34:21 +08:00
parent c60a12064c
commit 7d037a6e9a
9 changed files with 188 additions and 13 deletions

View File

@@ -53,6 +53,7 @@ npm install
**依赖说明**
- `express` - Web服务器框架
- `node-fetch` - HTTP请求库
- `https-proxy-agent` - 为外部请求提供代理支持
> 💡 **首次使用必须执行 `npm install`**,之后只需要 `npm start` 启动服务即可。
@@ -104,6 +105,30 @@ export DROID_REFRESH_KEY="your_refresh_token_here"
}
```
### 3. 配置网络代理(可选)
通过 `config.json``proxies` 数组为所有下游请求配置代理。数组为空表示直连;配置多个代理时会按照数组顺序轮询使用。
```json
{
"proxies": [
{
"name": "default-proxy",
"url": "http://127.0.0.1:3128"
},
{
"name": "auth-proxy",
"url": "http://username:password@123.123.123.123:12345"
}
]
}
```
- `url` 支持带用户名和密码的 `http://user:pass@host:port` 或 HTTPS 代理地址,必要时请为特殊字符进行 URL 编码。
- 每次请求都会调用下一项代理,配置发生变化时索引会自动重置。
- 当配置合法代理时,日志会输出类似 `[INFO] Using proxy auth-proxy for request to ...`,可用于验证命中情况。
- 代理数组留空或所有条目无效时,系统自动回退为直连。
#### 推理级别配置
每个模型支持五种推理级别: