From 70e74908a3ae3eb832daec399967cc04cfc4f835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Zetterstr=C3=B6m?= Date: Thu, 27 Jul 2017 14:04:45 +0200 Subject: [PATCH] the monkies are comming --- lib/node-http-proxy/proxy-table.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/node-http-proxy/proxy-table.js b/lib/node-http-proxy/proxy-table.js index f72c6f528..b4a35e16e 100644 --- a/lib/node-http-proxy/proxy-table.js +++ b/lib/node-http-proxy/proxy-table.js @@ -228,8 +228,15 @@ ProxyTable.prototype.getProxyLocation = function (req) { // if (validateRouteSource(route) && target.match(route.source.regexp)) { req.url = url.format(target.replace(route.source.regexp, '')); + + var protocol = route.target.url.protocol.replace(':', ''); + + if (route.target.url.port === '443') { + protocol = 'https'; + } + return { - protocol: route.target.url.protocol.replace(':', ''), + protocol: protocol, host: route.target.url.hostname, port: route.target.url.port || (this.target.https ? 443 : 80)