diff --git a/examples/http/reverse-proxy.js b/examples/http/reverse-proxy.js index 1e80d4e93fbb7e6e0f29bebde698cd006fec4aa2..11aed33758e741368efeaf23792ff5f10b385520 100644 --- a/examples/http/reverse-proxy.js +++ b/examples/http/reverse-proxy.js @@ -32,7 +32,8 @@ var proxy = httpProxy.createServer(); var server = http.createServer(function (req, res) { util.puts('Receiving reverse proxy request for:' + req.url); - proxy.web(req, res, {target: req.url, secure: false}); + var destinationServer="http://"+req.headers.host; + proxy.web(req, res, {target: destinationServer, secure: false}); }).listen(8213); server.on('connect', function (req, socket) {