node-http-proxy icon indicating copy to clipboard operation
node-http-proxy copied to clipboard

proxyReq.setHeader does not work

Open wwhgtt opened this issue 6 years ago • 5 comments
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

wwhgtt avatar Sep 20 '19 03:09 wwhgtt