Browse Source

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

pull/375/head
王良 2 months ago
parent
commit
616152db69
  1. 2
      packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js
  2. 2
      packages/mitmproxy/src/lib/interceptor/impl/req/sni.js

2
packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js

@ -124,7 +124,7 @@ module.exports = {
rOptions.agent = rOptions.agent.unVerifySslAgent
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' : ''))
} else {
res.setHeader('DS-Interceptor', `proxy: ${proxyTarget}`)

2
packages/mitmproxy/src/lib/interceptor/impl/req/sni.js

@ -12,7 +12,7 @@ module.exports = {
rOptions.agent = rOptions.agent.unVerifySslAgent
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' : ''))
return true

Loading…
Cancel
Save