Allow event observers to access upstream response headers and data.

This commit is contained in:
Colin Mollenhour 2012-12-29 01:23:46 -05:00 committed by indexzero
parent 9cecd97153
commit 4c130f5dac

View File

@ -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);