diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 8df6174..2538a6e 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -297,7 +297,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { catch (ex) { console.error("res.end error: %s", ex.message) } // Emit the `end` event now that we have completed proxying - self.emit('end', req, res); + self.emit('end', req, res, response); } }); @@ -318,6 +318,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { response.pause(); } } + self.emit('data', chunk, req); } response.on('data', ondata);