Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
proxy draft
var http = require('http');
http.createServer(function (req, res) {
req.pause();
var newReq = modifyRequest(req);
var proxy_req = http.request(newReq, function (proxy_res) {
req.resume();
req.pipe(proxy_req); //we miss trailer headers here
proxy_res.pipe(res); //we miss all headers here
});
}).listen(80, "127.0.0.1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.