mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Allow event observers to access upstream response headers and data.
This commit is contained in:
parent
9cecd97153
commit
4c130f5dac
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user