bugfix for https server

This commit is contained in:
OttoMao
2015-03-20 11:42:54 +08:00
parent 47b769c8e2
commit bdf5e4fabb
3 changed files with 19 additions and 11 deletions

View File

@@ -275,22 +275,26 @@ function connectReqHandler(req, socket, head){
internalHttpsPort,
httpsServerMgrInstance;
async.series([
//check if internal https server exists
function(callback){
if(internalHttpsPort){
if(!shouldIntercept){
callback();
return;
}else{
getPort(function(port){
internalHttpsPort = port;
httpsServerMgrInstance = new httpsServerMgr({
port :port,
handler :userRequestHandler
});
if(internalHttpsPort){
callback();
});
}else{
getPort(function(port){
internalHttpsPort = port;
httpsServerMgrInstance = new httpsServerMgr({
port :port,
handler :userRequestHandler
});
callback();
});
}
}
},