This commit is contained in:
avwo
2015-08-06 12:40:44 +08:00
parent 7fdd033653
commit 45dac48ca8
7 changed files with 315 additions and 16 deletions
+8 -6
View File
@@ -98,12 +98,14 @@ function handleWebsocket(socket, clientIp, callback) {
options = url.parse(fullUrl);
resolveHost(fullUrl, function(ip) {
var isWss = options.protocol == 'wss';
reqSocket = (isWss ? tls : net).connect({
rejectUnauthorized: false,
host: ip,
port: options.port || (isWss ? 443 : 80)
}, pipeData);
abortIfUnavailable(reqSocket);
util.domain.run(function() {
reqSocket = (isWss ? tls : net).connect({
rejectUnauthorized: false,
host: ip,
port: options.port || (isWss ? 443 : 80)
}, pipeData);
abortIfUnavailable(reqSocket);
});
});
}