mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[minor] Listen to error events re-emitted by pool into the ClientRequest
This commit is contained in:
parent
6d47d98f53
commit
f8bff4c618
@ -137,7 +137,7 @@ HttpProxy.prototype = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Add a listener for the connection timeout event
|
// Add a listener for the connection timeout event
|
||||||
reverse_proxy.connection.addListener('error', error);
|
reverse_proxy.addListener('error', error);
|
||||||
|
|
||||||
// Add a listener for the reverse_proxy response event
|
// Add a listener for the reverse_proxy response event
|
||||||
reverse_proxy.addListener('response', function (response) {
|
reverse_proxy.addListener('response', function (response) {
|
||||||
@ -173,7 +173,7 @@ HttpProxy.prototype = {
|
|||||||
// At the end of the client request, we are going to stop the proxied request
|
// At the end of the client request, we are going to stop the proxied request
|
||||||
req.addListener('end', function () {
|
req.addListener('end', function () {
|
||||||
reverse_proxy.end();
|
reverse_proxy.end();
|
||||||
reverse_proxy.connection.removeListener('error', error);
|
reverse_proxy.removeListener('error', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
self.unwatch(req);
|
self.unwatch(req);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user