Skip to content

Commit

Permalink
Allow event observers to access upstream response headers and data.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour authored and indexzero committed Mar 9, 2013
1 parent 9cecd97 commit 4c130f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand All @@ -318,6 +318,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
response.pause();
}
}
self.emit('data', chunk, req);
}

response.on('data', ondata);
Expand Down

0 comments on commit 4c130f5

Please sign in to comment.