日志优化。

pull/376/head
王良 1 month ago
parent 52a86328fb
commit 0c5920ee1b

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

@ -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 // 不拦截
}

Loading…
Cancel
Save