Node-http-proxy: cannot HTTPS->HTTPS and HTTP->HTTP on the same proxy

Created on 25 Oct 2015  路  1Comment  路  Source: http-party/node-http-proxy

When using proxy object to access both HTTP and HTTPS, HTTP works fine until an HTTPS request is sent through the object, at which point only HTTPS works and HTTP hangs with error: _Protocol "http" not supported. Expected "https"._ This behavior is confusing and costly to debug, and likely is caused by a state being set within http-proxy that cannot be reversed once an HTTPS request is initiated.

module.proxy        = httpProxy.createProxyServer();
module.proxyssl     = httpProxy.createProxyServer();
  if ( req.secure )
     module.proxyssl.web(req,res,options);
  else
     module.proxy.web(req,res,options);

Most helpful comment

I have the same issue here, seems not well explained in the docs.

>All comments

I have the same issue here, seems not well explained in the docs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgzhang picture lgzhang  路  4Comments

catamphetamine picture catamphetamine  路  6Comments

isawk picture isawk  路  5Comments

tbc1 picture tbc1  路  4Comments

SET001 picture SET001  路  5Comments