Skip to content

Commit f8bff4c

Browse files
committed
[minor] Listen to error events re-emitted by pool into the ClientRequest
1 parent 6d47d98 commit f8bff4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/node-http-proxy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ HttpProxy.prototype = {
137137
};
138138

139139
// Add a listener for the connection timeout event
140-
reverse_proxy.connection.addListener('error', error);
140+
reverse_proxy.addListener('error', error);
141141

142142
// Add a listener for the reverse_proxy response event
143143
reverse_proxy.addListener('response', function (response) {
@@ -173,7 +173,7 @@ HttpProxy.prototype = {
173173
// At the end of the client request, we are going to stop the proxied request
174174
req.addListener('end', function () {
175175
reverse_proxy.end();
176-
reverse_proxy.connection.removeListener('error', error);
176+
reverse_proxy.removeListener('error', error);
177177
});
178178

179179
self.unwatch(req);

0 commit comments

Comments
 (0)