Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue #364 'proxyError' event emitted twice #374

Merged
merged 2 commits into from
Mar 9, 2013

Conversation

erasmospunk
Copy link
Contributor

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:

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'

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.

@indexzero
Copy link
Contributor

Your logic is sound, but if you're going to remove code, remove it. Don't comment it out with big comments saying why it shouldn't be there.

@erasmospunk
Copy link
Contributor Author

You are right, just removed.

indexzero added a commit that referenced this pull request Mar 9, 2013
fixed issue #364 'proxyError' event emitted twice
@indexzero indexzero merged commit 8b38c99 into http-party:master Mar 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants