From a9cec8112a3c82cff24171e7f49a85b87b9edb4d Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Fri, 12 Jul 2024 13:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20pref:=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E6=9C=AA=E6=9D=A5=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index e13afcb..74b8b1b 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -6,7 +6,7 @@ import { Buffer } from 'node:buffer'; import axios from "axios"; import _ from "lodash"; import tunnel from "tunnel"; -import HttpProxyAgent from "https-proxy-agent"; +import { HttpsProxyAgent } from 'https-proxy-agent'; import { exec, execSync } from "child_process"; import { checkAndRemoveFile, deleteFolderRecursive, mkdirIfNotExists } from "../utils/file.js"; import { @@ -676,7 +676,7 @@ export class tools extends plugin { "authorization": `Bearer ${ Buffer.from(TWITTER_BEARER_TOKEN, "base64").toString() }` }, ...params, - agent: !isOversea ? '' : new HttpProxyAgent(this.myProxy), + agent: !isOversea ? '' : new HttpsProxyAgent(this.myProxy), }).then(async resp => { logger.info(resp) e.reply(`识别:小蓝鸟学习版,${ resp.data.text }`); @@ -889,7 +889,7 @@ export class tools extends plugin { return new Promise((resolve, reject) => { fetch(url, { timeout: 10000, - agent: isOversea ? '' : new HttpProxyAgent(this.myProxy), + agent: isOversea ? '' : new HttpsProxyAgent(this.myProxy), redirect: "follow", follow: 10, })