nodejitsu/node-http-proxy — Issue #139: More events managed by RoutingProxy
Author: gonzaloruizdevilla
Created: 2011-10-25 08:59:44+00:00
State: open

I wanted to handle the 'start' event from http-proxy with some code like this one:

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

var server = httpProxy.createServer(function (req, res, proxy) {
proxy.proxyRequest(req, res, {
host: 'localhost',
port: 8001
});

})

server.listen(8000);

server.proxy.on('start',function(req, res, proxy){
console.log("Do something");
})
```

To make this work, I had to add to routing-proxy.js line 93:

```javascript
this.proxies[key].on('start', this.emit.bind(this, 'start'));
```

I guess that the same should be done with other events (forward)