diff --git a/packages/core/src/shell/scripts/set-system-proxy/index.js b/packages/core/src/shell/scripts/set-system-proxy/index.js index 1e92870..18df972 100644 --- a/packages/core/src/shell/scripts/set-system-proxy/index.js +++ b/packages/core/src/shell/scripts/set-system-proxy/index.js @@ -166,7 +166,8 @@ function getDomesticDomainAllowList () { log.info('读取已下载的 domestic-domain-allowlist.txt 文件:', fileAbsolutePath) } else { // 如果临时文件不存在,则使用内置文件 - fileAbsolutePath = path.join(__dirname, '../../gui/', config.get().proxy.domesticDomainAllowListFilePath) + log.info('__dirname:', __dirname) + fileAbsolutePath = path.join(__dirname, '../', config.get().proxy.domesticDomainAllowListFilePath) log.info('读取内置的 domestic-domain-allowlist.txt 文件:', fileAbsolutePath) } } else { @@ -176,7 +177,7 @@ function getDomesticDomainAllowList () { try { return fs.readFileSync(fileAbsolutePath).toString() } catch (e) { - log.error('读取 domestic-domain-allowlist.txt 文件失败:', fileAbsolutePath) + log.error(`读取 domestic-domain-allowlist.txt 文件失败: ${fileAbsolutePath}, error:`, e) return null } } diff --git a/packages/gui/extra/proxy/china-domain-allowlist.txt b/packages/gui/extra/proxy/domestic-domain-allowlist.txt similarity index 100% rename from packages/gui/extra/proxy/china-domain-allowlist.txt rename to packages/gui/extra/proxy/domestic-domain-allowlist.txt diff --git a/packages/mitmproxy/src/lib/proxy/middleware/source/pac.js b/packages/mitmproxy/src/lib/proxy/middleware/source/pac.js index 5c0e00c..e7b86c0 100644 --- a/packages/mitmproxy/src/lib/proxy/middleware/source/pac.js +++ b/packages/mitmproxy/src/lib/proxy/middleware/source/pac.js @@ -8,6 +8,7 @@ function createPacClient (pacFilePath) { function readFile (location) { try { log.info('pac root dir:', path.resolve('./')) + log.info('pac location:', location) const filePath = path.resolve(location) log.info('read pac path:', filePath) return fs.readFileSync(location).toString() diff --git a/packages/mitmproxy/src/options.js b/packages/mitmproxy/src/options.js index f7db3c8..89e76ed 100644 --- a/packages/mitmproxy/src/options.js +++ b/packages/mitmproxy/src/options.js @@ -69,7 +69,9 @@ module.exports = (serverConfig) => { } if (!pacConfig.pacFileAbsolutePath) { + log.info('setting.rootDir:', setting.rootDir) pacConfig.pacFileAbsolutePath = path.join(setting.rootDir, pacConfig.pacFilePath) + log.info('读取内置的 pac.txt 文件:', pacConfig.pacFileAbsolutePath) if (pacConfig.autoUpdate) { log.warn('远程 pac.txt 文件下载失败或还在下载中,现使用内置 pac.txt 文件:', pacConfig.pacFileAbsolutePath) }