nodejitsu/node-http-proxy — pull request #374 by erasmospunk (2013-02-10 22:42:11+00:00)
Title: fixed issue #364 'proxyError' event emitted twice

For this issue I just commented instead of deleting the unneeded code because I only tried the normal http parts, not the web sockets but I believe that 99,9% is correct.

After some research this part is causing the problem:

```javascript
reverseProxy.once('socket', function (socket) {
socket.once('error', proxyError);
});
```

This is not needed as node.js' `ClientRequest` object (here the `reverseProxy`) attaches a listener to the socket 'error'
```javascript
socket.on('error', socketErrorListener);
```
The `socketErrorListener` just re-emits the error from the `ClientRequest` object.

Look in https://github.com/joyent/node/blob/master/lib/http.js for the `socketErrorListener` references.