From 8c70630d2de6e558a55d5b2a07ad02379386c5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=99=97?= <673058687@qq.com> Date: Sun, 20 Aug 2023 11:12:48 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=B8=A6?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E5=AF=86=E7=A0=81=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/request.js b/util/request.js index e30a404c32a..6bf1628c01f 100644 --- a/util/request.js +++ b/util/request.js @@ -147,10 +147,11 @@ const createRequest = (method, url, data = {}, options) => { } else { const purl = new URL(options.proxy) if (purl.hostname) { - const agent = tunnel.httpsOverHttp({ + const agent = tunnel[purl.protocol === 'https' ? 'httpsOverHttp' : 'httpOverHttp']({ proxy: { host: purl.hostname, port: purl.port || 80, + proxyAuth: purl.username && purl.password ? (purl.username + ':' + purl.password) : '' }, }) settings.httpsAgent = agent