mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] Handle socket errors
This commit is contained in:
parent
7bc1a628fe
commit
2a61ec85bd
@ -314,6 +314,9 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
|
|||||||
// Handle 'error' events from the `reverseProxy`.
|
// Handle 'error' events from the `reverseProxy`.
|
||||||
//
|
//
|
||||||
reverseProxy.once('error', proxyError);
|
reverseProxy.once('error', proxyError);
|
||||||
|
reverseProxy.once('socket', function (socket) {
|
||||||
|
socket.once('error', proxyError);
|
||||||
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
// If `req` is aborted, we abort our `reverseProxy` request as well.
|
// If `req` is aborted, we abort our `reverseProxy` request as well.
|
||||||
@ -724,6 +727,9 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
|
|||||||
});
|
});
|
||||||
|
|
||||||
reverseProxy.on('error', proxyError);
|
reverseProxy.on('error', proxyError);
|
||||||
|
reverseProxy.once('socket', function (socket) {
|
||||||
|
socket.once('error', proxyError);
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user