diff --git a/lib/httpsServerMgr.js b/lib/httpsServerMgr.js index ffc66d5..824bf42 100644 --- a/lib/httpsServerMgr.js +++ b/lib/httpsServerMgr.js @@ -62,13 +62,11 @@ module.exports =function(config){ } certMgr.getCertificate("anyproxy_internal_https_server",function(err,keyContent,crtContent){ - https.createServer({ SNICallback : SNIPrepareCert , key : keyContent, cert : crtContent },config.handler).listen(config.port); - }); } diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 8e28340..3a92b80 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -303,7 +303,7 @@ function connectReqHandler(req, socket, head){ callback(); }else{ - proxyPort = (targetPort == 8003)?8003:443; //ws + proxyPort = (targetPort == 80)? 443 : targetPort; proxyHost = host; callback(); diff --git a/package.json b/package.json index 6c7af0b..9a190a0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "proxy-eval": ">=1.1.1" }, "scripts": { - "test": "node test.js" + "test": "sh test.sh" }, "optionalDependencies": {}, "repository": { diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..7dd2ea7 --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +node -v +node test.js \ No newline at end of file