node-http-proxy
node-http-proxy copied to clipboard
can't proxy https request
trafficstars
My script looks like this:
var http = require('http'),
httpProxy = require('http-proxy');
var addresses = [
{
host: 'localhost',
port: 8888
},
];
var proxy = httpProxy.createServer();
http.createServer(function (req, res) {
var target = { target: addresses.shift() };
console.log('balancing request to: ', target);
proxy.web(req, res, target);
addresses.push(target.target);
}).listen(5050);
When I do:
curl http://httpbin.org/ip
it works, but when I do:
curl https://httpbin.org/ip
I get:
curl: (56) Proxy CONNECT aborted