拦截器 proxy.js 和 sni.js,响应头调整。

pull/375/head
王良 2 months ago
parent 50b9674f47
commit 616152db69

@ -124,7 +124,7 @@ module.exports = {
rOptions.agent = rOptions.agent.unVerifySslAgent rOptions.agent = rOptions.agent.unVerifySslAgent
unVerifySsl = true unVerifySsl = true
} }
res.setHeader('DS-Interceptor', `proxy: ${proxyTarget}, sni: ${interceptOpt.sni}`, (unVerifySsl ? ', unVerifySsl' : '')) res.setHeader('DS-Interceptor', `proxy: ${proxyTarget}, sni: ${interceptOpt.sni}${unVerifySsl ? ', unVerifySsl' : ''}`)
log.info('proxy intercept: hostname:', originHostname, ', target', proxyTarget, ', sni replace servername:', rOptions.servername, (unVerifySsl ? ', unVerifySsl' : '')) log.info('proxy intercept: hostname:', originHostname, ', target', proxyTarget, ', sni replace servername:', rOptions.servername, (unVerifySsl ? ', unVerifySsl' : ''))
} else { } else {
res.setHeader('DS-Interceptor', `proxy: ${proxyTarget}`) res.setHeader('DS-Interceptor', `proxy: ${proxyTarget}`)

@ -12,7 +12,7 @@ module.exports = {
rOptions.agent = rOptions.agent.unVerifySslAgent rOptions.agent = rOptions.agent.unVerifySslAgent
unVerifySsl = true unVerifySsl = true
} }
res.setHeader('DS-Interceptor', `sni: ${interceptOpt.sni}`, (unVerifySsl ? ', unVerifySsl' : '')) res.setHeader('DS-Interceptor', `sni: ${interceptOpt.sni}${unVerifySsl ? ', unVerifySsl' : ''}`)
log.info('sni intercept: sni replace servername:', rOptions.hostname, '➜', rOptions.servername, (unVerifySsl ? ', unVerifySsl' : '')) log.info('sni intercept: sni replace servername:', rOptions.hostname, '➜', rOptions.servername, (unVerifySsl ? ', unVerifySsl' : ''))
return true return true

Loading…
Cancel
Save