I need to create proxy according to some URL which is coming from the browser, since I fairly new to this topic Im not sure how to test it...:( I need some way to test it and see that this is actually working I use this following code from this blog
http://blog.nodejitsu.com/node-http-proxy-1dot0/
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy();
var options = {
'foo.com': 'http://website.com:8001',
'bar.com': 'http://website2.com:8002'
}
require('http').createServer(function(req, res) {
proxy.web(req, res, {
target: options[req.headers.host]
});
}).listen(8000);
what I need is when you put in the browser localhost:8000 you will be route(proxy) to new server with diffrent path as described in the options.