Skip to content

Commit

Permalink
[fix] Change variable references for Websockets, bugs found from usin…
Browse files Browse the repository at this point in the history
…g wsbench
  • Loading branch information
indexzero committed May 19, 2011
1 parent 32a15dd commit 7bf0cae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/node-http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,10 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options

// Detach event listeners from reverseProxy
function detach() {
reverseProxy.removeListener('close', listeners._r_close);
reverseProxy.removeListener('end', listeners._r_close);
reverseProxy.removeListener('data', listeners._r_data);
out.incoming.socket.removeListener('data', listeners._data);
out.incoming.socket.removeListener('close', listeners._close);
out.incoming.socket.removeListener('end', listeners._close);
}

// Hook disconnections
Expand All @@ -591,7 +591,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
detach();
});

socket.on('end', listeners._close = function() {
out.incoming.socket.on('end', listeners._close = function() {
reverseProxy.end();
detach();
});
Expand Down

0 comments on commit 7bf0cae

Please sign in to comment.