node-http-proxy icon indicating copy to clipboard operation
node-http-proxy copied to clipboard

can't proxy https request

Open ghost opened this issue 8 years ago • 9 comments
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

ghost avatar Oct 10 '17 03:10 ghost