From a619741d2c5b5f1642c03b67b2792c90be23ae8a Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 1 Aug 2021 21:59:30 +0800 Subject: [PATCH] rename http2https to redirectHttp2Https, proxy to proxyHttps2Http --- server.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index 7a3550c..0131fe9 100644 --- a/server.js +++ b/server.js @@ -160,7 +160,7 @@ if (typeof wo.envi.ssl === 'string') { ) }) // } - } else if ('http2https' === wo.envi.protocol) { + } else if ('redirectHttp2Https' === wo.envi.protocol) { webServer = require('http') .createServer( server.all('*', function (ask, reply) { @@ -175,7 +175,7 @@ if (typeof wo.envi.ssl === 'string') { `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttp} with IPv4=${ipv4} for ${wo.envi.prodev} environment` ) }) - }else if ('proxy' === wo.envi.protocol) { + }else if ('proxyHttps2Http' === wo.envi.protocol) { var proxy=require('http-proxy').createProxyServer({ ssl: { key: fs.readFileSync(wo.envi.ssl.file.key), @@ -190,9 +190,8 @@ if (typeof wo.envi.ssl === 'string') { res.writeHead(500, { 'Content-Type': 'text/plain' }) res.end('Proxy Error.') }) - wo.envi.port=443 - proxy.listen(wo.envi.port) - console.info('server listening on %s://%s:%d as proxy', wo.envi.protocol, wo.envi.host, wo.envi.port) + proxy.listen(portHttps) + console.info('server listening on %s://%s:%d as proxy', wo.envi.protocol, wo.envi.host, portHttps) }