Skip to content

Instantly share code, notes, and snippets.

@AndreasMadsen
Created February 15, 2012 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreasMadsen/1837361 to your computer and use it in GitHub Desktop.
Save AndreasMadsen/1837361 to your computer and use it in GitHub Desktop.
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