Permalink
Browse files

Merge pull request #374 from erasmospunk/master

fixed issue #364 'proxyError' event emitted twice
  • Loading branch information...
2 parents c686ac7 + 3b84e27 commit 8b38c994a9f92afd0049d4a2de3a33789b0c9198 @indexzero indexzero committed Mar 9, 2013
Showing with 3 additions and 9 deletions.
  1. +3 −9 lib/node-http-proxy/http-proxy.js
@@ -312,9 +312,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
// Handle 'error' events from the `reverseProxy`.
//
reverseProxy.once('error', proxyError);
- reverseProxy.once('socket', function (socket) {
- socket.once('error', proxyError);
- });
//
// Handle 'error' events from the `req` (e.g. `Parse Error`).
@@ -719,20 +716,17 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
return proxyError(ex);
}
- // Catch socket errors
- socket.on('error', proxyError);
-
//
// Remove data listener now that the 'handshake' is complete
//
revSocket.removeListener('data', handshake);
});
});
+ //
+ // Handle 'error' events from the `reverseProxy`.
+ //
reverseProxy.on('error', proxyError);
- reverseProxy.once('socket', function (socket) {
- socket.once('error', proxyError);
- });
//
// Handle 'error' events from the `req` (e.g. `Parse Error`).

0 comments on commit 8b38c99

Please sign in to comment.