From d7173b9d4fdacc8f73aba2cd56bbff6aff7d36db Mon Sep 17 00:00:00 2001
From: OttoMao <ottomao@gmail.com>
Date: Thu, 12 Feb 2015 14:37:44 +0800
Subject: [PATCH] update test script

---
 lib/httpsServerMgr.js | 2 --
 lib/requestHandler.js | 2 +-
 package.json          | 2 +-
 test.sh               | 4 ++++
 4 files changed, 6 insertions(+), 4 deletions(-)
 create mode 100755 test.sh

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