From 5681fc1a28ff06dfa91d9bf5512c688235cafac4 Mon Sep 17 00:00:00 2001 From: indexzero Date: Fri, 15 Apr 2011 21:09:54 -0400 Subject: [PATCH] [api] Emit `end` event when done proxying --- lib/node-http-proxy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index 3af5990..bff066b 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -359,6 +359,9 @@ HttpProxy.prototype.proxyRequest = function (req, res, port, host, buffer) { if (!errState) { reverseProxy.removeListener('error', proxyError); res.end(); + + // Emit the `end` event now that we have completed proxying + self.emit('end', req, res); } }); });