I have the same problem. I do not see anything. Here is mine, which is slightly different (the second one corresponds to the examples that I see from the github examples):
var https = require('https'); var httpProxy = require('http-proxy/lib/node-http-proxy'); var helpers = require('http-proxy/test/helpers'); var request = require('request'); https.createServer(function(req, response) { try { console.log("forwarding https", req); var proxy_request = request(req); proxy_request.pipe(response); } catch (err) { console.log("Forwarding server caught error:\n" + err + "\n") } }).listen(9001); httpProxy.createServer(function (req, res, proxy) { console.log("Got request!"); proxy.proxyRequest(req, res, { port: 9001, host: 'localhost', buffer: httpProxy.buffer(req) }); }, { https: helpers.https }).listen(8001);
... I also tried a simpler one:
httpProxy.createServer(9001, 'localhost', { https: helpers.https }).listen(8001)
When I set the Firefox https proxy port to 8001 and go anywhere, I get "The connection was reset."
I do the same with "http", replacing "https" and everything works fine.
source share