Created
October 26, 2018 08:24
-
-
Save fohlin/8a50e72f6554c115ebae32c4f4732899 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var httpProxy = require('http-proxy'); | |
var proxy = httpProxy.createProxyServer({target:'http://localhost:3000'}); | |
proxy.on('proxyReq', function(proxyReq, req, res, options) { | |
console.info(req); | |
res.setHeader('X-Special-Proxy-Header', 'foobar'); | |
proxyReq.setHeader('X-Special-Proxy-Header', 'foobar'); | |
}); | |
proxy.listen(8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment