nodejitsu/node-http-proxy — pull request #216 by CodeRarity (2012-03-28 02:02:31+00:00)
Title: Re-emit 'start', 'forward' and 'end' events in RoutingProxy

Fixes nodejitsu/node-http-proxy#214. This will re-emit more events from RoutingProxy so that you can listen for those events yourself. Be VERY careful for the following case, which will add a new listener for every request:

```javascript
var httpProxy = require('http-proxy');

httpProxy.createServer(function (req, res, proxy) {

var buffer = httpProxy.buffer(req);

proxy.on('end', function() {
console.log("The request was proxied (server)");
});

proxy.proxyRequest(req, res, {
host: '127.0.0.1',
port: 8080,
buffer: buffer
});

}).listen(8000);
```

It would be good if we could fix this case! This is a very easy problem to run into!