fix https issue

This commit is contained in:
加里
2014-09-11 14:17:48 +08:00
parent 179090382f
commit 45433d6e0c
3 changed files with 7 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ var httpsServerMgrInstance = new httpsServerMgr(),
userRule = defaultRule; //init
function userRequestHandler(req,userRes){
var host = req.headers.host,
urlPattern = url.parse(req.url),
path = urlPattern.path,
@@ -220,6 +221,11 @@ function connectReqHandler(req, socket, head){
var shouldIntercept = userRule.shouldInterceptHttpsReq(req);
//bypass webSocket on webinterface
if(targetPort == 8003){
shouldIntercept = false; // TODO : a more general solution?
}
console.log(color.green("\nreceived https CONNECT request " + host));
if(shouldIntercept){
console.log("==>will forward to local https server");