add proxy support

This commit is contained in:
Archeb
2024-05-15 13:24:44 +08:00
committed by 蚊子
parent 1e9ec66c70
commit 2c8e7b845a
4 changed files with 63 additions and 4 deletions
+3
View File
@@ -2,6 +2,8 @@ const express = require("express");
const FormData = require("form-data");
const docx = require("docx");
const { v4: uuidv4 } = require("uuid");
const { ProxyAgent } = require("proxy-agent");
const agent = new ProxyAgent();
const app = express();
const axios = require("axios");
const port = 8080;
@@ -95,6 +97,7 @@ app.post("/v1/messages", apiKeyAuth, (req, res) => {
"User-Agent": session.user_agent,
"Cookie": session.cookie,
},
httpsAgent: agent,
});
// 试算用户消息长度