node-http-proxy
node-http-proxy copied to clipboard
proxyReq.setHeader does not work
trafficstars
here is my code
const HttpProxy = require('http-proxy')
const proxy = HttpProxy.createProxyServer()
proxy.on('proxyReq', function(proxyReq, req, res) {
proxyReq.setHeader('cookie', req.headers.authorization);
console.log('proxyReq', req.headers);
});
proxy.web(ctx.req, ctx.res, pxy.proxy)
request method is GET
my target is add cookie on request header