mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Merge pull request #374 from erasmospunk/master
fixed issue #364 'proxyError' event emitted twice
This commit is contained in:
commit
8b38c994a9
@ -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,9 +716,6 @@ 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
|
||||
//
|
||||
@ -729,10 +723,10 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
|
||||
});
|
||||
});
|
||||
|
||||
//
|
||||
// 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`).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user