Browse Source

optimize: 请求返回日志,添加响应码。

pull/384/head
王良 3 weeks ago
parent
commit
a66af327c1
  1. 4
      packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js

4
packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js

@ -153,9 +153,9 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e
proxyReq = (rOptions.protocol === 'https:' ? https : http).request(rOptions, (proxyRes) => { proxyReq = (rOptions.protocol === 'https:' ? https : http).request(rOptions, (proxyRes) => {
const cost = new Date() - start const cost = new Date() - start
if (rOptions.protocol === 'https:') { if (rOptions.protocol === 'https:') {
log.info(`代理请求返回: ${url}, cost: ${cost} ms`) log.info(`代理请求返回: ${proxyRes.statusCode}${url}, cost: ${cost} ms`)
} else { } else {
log.info(`请求返回: ${url}, cost: ${cost} ms`) log.info(`请求返回: ${proxyRes.statusCode}${url}, cost: ${cost} ms`)
} }
// console.log('request:', proxyReq, proxyReq.socket) // console.log('request:', proxyReq, proxyReq.socket)

Loading…
Cancel
Save