Created
September 30, 2014 01:36
-
-
Save matthewp/ec09a03643bf3f429753 to your computer and use it in GitHub Desktop.
Simple proxy in node
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 httpProxy = require('http-proxy'); | |
var http = require('http'); | |
var proxy = httpProxy.createProxyServer({}); | |
var server = http.createServer(function(req, res) { | |
var url = req.url; | |
console.log(url); | |
proxy.web(req, res, { target: url }); | |
}); | |
server.listen(9000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment