代理拦截器:添加日志。

pull/284/head
王良 2024-03-26 21:51:00 +08:00
parent 1b96838e67
commit d6a1d40cf6
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,8 @@ module.exports = {
requestIntercept (context, interceptOpt, req, res, ssl, next) {
const { rOptions, log, RequestCounter } = context
const originHostname = rOptions.hostname
let proxyConf = interceptOpt.proxy
if (RequestCounter && interceptOpt.backup && interceptOpt.backup.length > 0) {
// 优选逻辑
@ -67,7 +69,11 @@ module.exports = {
if (rOptions.agent && rOptions.agent.options) {
rOptions.agent.options.rejectUnauthorized = false
}
log.info('proxy intercept: hostname:', originHostname, ', target', proxyTarget, ', sni replace servername:', rOptions.servername)
} else {
log.info('proxy intercept: hostname:', originHostname, ', target', proxyTarget)
}
return true
},
is (interceptOpt) {