can't proxy https request
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
I'm no expert, but I believe this question is better asked in a QA site, normally issues are raised to do with the code based, rather than a HOW TO. Maybe try stack overflow.
Not super-helpful, @hutber.
On Tue, Oct 24, 2017 at 5:28 PM, Jamie Hutber [email protected] wrote:
I'm no expert, but I believe this question is better asked in a QA site, normally issues are raised to do with the code based, rather than a HOW TO. Maybe try stack overflow.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nodejitsu/node-http-proxy/issues/1206#issuecomment-338930584, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1afBhSRM3_Qh_hNgcNpqWbobpBWnKOks5sva2kgaJpZM4PzT7t .
@monkeysuffrage did you figure this one out?
@monkeysuffrage it was meant to encourage you to ask the question on another site designed for asking for help about your implimentation, github is used for issue reporting. Maybe start another question on one of the QA sites and then link to it from here.
Well it feels like an issue to me and nobody's bothered to close it after all this time...
On Mon, Mar 5, 2018 at 5:45 PM, Jamie Hutber [email protected] wrote:
@monkeysuffrage https://github.com/monkeysuffrage it was meant to encourage you to ask the question on another site designed for asking for help about your implimentation, github is used for issue reporting. Maybe start another question on one of the QA sites and then link to it from here.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejitsu/node-http-proxy/issues/1206#issuecomment-370364143, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1afI2LER23BH2SuuDulXqESlOjwDFyks5tbQlOgaJpZM4PzT7t .
Yep totally :) Was just a suggestion from my end. Not trying to be a dick
@monkeysuffrage This lib does not support https request. You need to implement it by yourself. Basicly you need to implement the http CONNECT method. You can find more infomation here https://stackoverflow.com/questions/8165570/https-proxy-server-in-node-js
I found a really good proxy lib that I'm using instead that handles HTTP/HTTPS out of the box: https://github.com/alibaba/anyproxy. It might be too heavy or non-configurable for what you want.
It's 2023, Does the Issue still exist, or any work around there to figure it out?