mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fix incorrect target name for reverse proxy example (#1135)
This commit is contained in:
parent
b4028ba78b
commit
244303b994
@ -31,8 +31,9 @@ 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 parsedUrl = url.parse(req.url);
|
||||
var target = parsedUrl.protocol + '//' + parsedUrl.hostname;
|
||||
proxy.web(req, res, {target: target, secure: false});
|
||||
}).listen(8213);
|
||||
|
||||
server.on('connect', function (req, socket) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user