Last active
August 29, 2015 13:57
-
-
Save ivoputzer/9781627 to your computer and use it in GitHub Desktop.
Node http proxy
This file contains 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 http = require('http') | |
http.createServer(function(req, res) { | |
var proxy = http.get({ hostname: process.argv[process.argv.length -1], port: 80, path: req.url }, function(r) { | |
r.pipe(res) | |
}) | |
}).listen(8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment