diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 5ec206e14..6a08f2c7d 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -318,7 +318,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { }); // Allow observer to modify headers or abort response - try { req.emit('proxyResponse', req, res, response) } + try { self.emit('proxyResponse', req, res, response) } catch (ex) { errState = true; return; diff --git a/lib/node-http-proxy/routing-proxy.js b/lib/node-http-proxy/routing-proxy.js index 98c7a79d9..a8d0eade5 100644 --- a/lib/node-http-proxy/routing-proxy.js +++ b/lib/node-http-proxy/routing-proxy.js @@ -116,6 +116,7 @@ RoutingProxy.prototype.add = function (options) { 'start', 'forward', 'end', + 'proxyResponse', 'websocket:start', 'websocket:end', 'websocket:incoming',