diff --git a/packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js b/packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js index 8a4a769..45c3e44 100644 --- a/packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js +++ b/packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js @@ -4,6 +4,7 @@ const log = require('../../../utils/util.log') const DnsUtil = require('../../dns/index') const localIP = '127.0.0.1' const dnsLookup = require('./dnsLookup') +const jsonApi = require('../../../json') function isSslConnect (sslConnectInterceptors, req, cltSocket, head) { for (const intercept of sslConnectInterceptors) { @@ -44,7 +45,7 @@ module.exports = function createConnectHandler (sslConnectInterceptor, middlewar log.error(`----- fakeServer getServerPromise error: ${hostname}:${port}, error:`, e) }) } else { - log.info(`未匹配到任何 sslConnectInterceptors,不拦截请求,直接连接目标服务器: ${hostname}:${port}, headers:`, req.headers) + log.info(`不拦截请求,直连目标服务器: ${hostname}:${port}, headers:`, jsonApi.stringify2(req.headers)) connect(req, cltSocket, head, hostname, port, dnsConfig, true) } } diff --git a/packages/mitmproxy/src/options.js b/packages/mitmproxy/src/options.js index 84bb488..1a165fc 100644 --- a/packages/mitmproxy/src/options.js +++ b/packages/mitmproxy/src/options.js @@ -6,6 +6,7 @@ const path = require('path') const fs = require('fs') const lodash = require('lodash') const scriptInterceptor = require('./lib/interceptor/impl/res/script') +const jsonApi = require('./json') const { getTmpPacFilePath, downloadPacAsync, createOverwallMiddleware } = require('./lib/proxy/middleware/overwall') @@ -110,7 +111,7 @@ module.exports = (serverConfig) => { // 配置了白名单的域名,将跳过代理 const inWhiteList = matchUtil.matchHostname(whiteList, hostname, 'in whiteList') != null if (inWhiteList) { - log.info(`为白名单域名,不拦截: ${hostname}, headers:`, req.headers) + log.info(`为白名单域名,不拦截: ${hostname}, headers:`, jsonApi.stringify2(req.headers)) return false // 不拦截 }