From 1f3786ac6f41e4ad38b0c248256ce4454ebc4c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Wed, 6 Nov 2024 11:33:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E5=85=81=E8=AE=B8=E8=BF=9C=E7=A8=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=85=8D=E7=BD=AE=E6=9F=90=E4=B8=AA=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=20false=EF=BC=8C=E8=B7=B3=E8=BF=87=20pac.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mitmproxy/src/lib/proxy/middleware/overwall.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js index 50230c7..efee824 100644 --- a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js +++ b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js @@ -10,17 +10,23 @@ const { Buffer } = require('buffer') let pacClient = null function matched (hostname, overWallTargetMap) { + // 匹配配置文件 const ret1 = matchUtil.matchHostname(overWallTargetMap, hostname, 'matched overwall') if (ret1) { - return 'overwall config' + return 'in config' + } else if (ret1 === false || ret1 === 'false') { + log.info(`域名 ${hostname} 的overwall配置为 false,跳过增强功能,即使它在 pac.txt 里`) + return null } + + // 匹配 pac.txt if (pacClient == null) { return null } const ret = pacClient.FindProxyForURL('https://' + hostname, hostname) if (ret && ret.indexOf('PROXY ') === 0) { log.info(`matchHostname: matched overwall: '${hostname}' -> '${ret}' in pac.txt`) - return 'overwall pac' + return 'in pac.txt' } else { log.debug(`matchHostname: matched overwall: Not-Matched '${hostname}' -> '${ret}' in pac.txt`) return null