-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
我想请求一个地址例如
https://xxx.abc.com/ckd/
然后在responseInterceptor把我�透明传输本地的一个响应过来
const mitmproxyConfig = {
sslConnectInterceptor: (req, cltSocket, head) => {
console.log('head', head)
return true
},
requestInterceptor: (rOptions, req, res, ssl, next) => {
console.log(`正在访问:${rOptions.protocol}//${rOptions.hostname}:${rOptions.port}`)
console.log('cookie:', rOptions.headers.cookie)
// res.end('Hello node-mitmproxy!')
next()
},
responseInterceptor: (req, res, proxyReq, proxyRes, ssl, next) => {
req.pipe(request('http://localhost:9850/ckd')).pipe(res)
next()
},
}
mitmproxy.createProxy(mitmproxyConfig)
但是这样的话一直报错 uncaughtException: Error: write after end
我怎么能做到这一点呢
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels