From f8bff4c618ab2a6b6185ac973cd0e21cea19c23a Mon Sep 17 00:00:00 2001 From: indexzero Date: Fri, 10 Sep 2010 17:34:38 -0400 Subject: [PATCH] [minor] Listen to error events re-emitted by pool into the ClientRequest --- lib/node-http-proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index 768cff8e6..bbb5b0fc3 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -137,7 +137,7 @@ HttpProxy.prototype = { }; // 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 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 req.addListener('end', function () { reverse_proxy.end(); - reverse_proxy.connection.removeListener('error', error); + reverse_proxy.removeListener('error', error); }); self.unwatch(req);