fix: 修复关闭pac无效的bug

pull/192/head
18603046467 2021-11-21 23:14:07 +08:00
parent 246da361a8
commit 9c7fb89265
2 changed files with 5 additions and 2 deletions

View File

@ -163,7 +163,7 @@ module.exports = {
'www.googleapis.com': { '.*': { abort: false, desc: '设置aborttrue可以快速失败节省时间' } },
'lh*.googleusercontent.com': { '.*': { abort: false, desc: '设置aborttrue可以快速失败节省时间' } },
// 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'
}

View File

@ -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)
}