From 9c7fb8926523f08353dc3b41fe131ad3d8073060 Mon Sep 17 00:00:00 2001 From: 18603046467 Date: Sun, 21 Nov 2021 23:14:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=ADpac?= =?UTF-8?q?=E6=97=A0=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/config/index.js | 2 +- packages/mitmproxy/src/lib/proxy/middleware/overwall.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js index 788d2cf..5514dc3 100644 --- a/packages/core/src/config/index.js +++ b/packages/core/src/config/index.js @@ -163,7 +163,7 @@ module.exports = { 'www.googleapis.com': { '.*': { abort: false, desc: '设置abort:true可以快速失败,节省时间' } }, 'lh*.googleusercontent.com': { '.*': { abort: false, desc: '设置abort:true可以快速失败,节省时间' } }, // mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.0/napi-v3-win32-x64.tar.gz - '*.s3.amazonaws.com': { + '*.s3.1amazonaws1.com': { '/sqlite3/.*': { redirect: 'npm.taobao.org/mirrors' } diff --git a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js index d72bf07..22af3a6 100644 --- a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js +++ b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js @@ -8,6 +8,9 @@ function matched (hostname, regexpMap) { if (ret1) { return true } + if (pacClient == null) { + return false + } const ret = pacClient.FindProxyForURL('https://' + hostname, hostname) if (ret && ret.indexOf('PROXY ') === 0) { return true @@ -19,7 +22,7 @@ module.exports = function createOverWallIntercept (overWallConfig) { if (!overWallConfig || overWallConfig.enabled !== true) { return null } - if (overWallConfig.pac) { + if (overWallConfig.pac && overWallConfig.pac.enabled) { // 初始化pac pacClient = pac.createPacClient(overWallConfig.pac.pacFileAbsolutePath) }