-
Notifications
You must be signed in to change notification settings - Fork 99
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
Is remoteAddress going to always be the same for applications behind a proxy? #6
Comments
Hm... sounds like an awesome configuration option. What do you think about sending a PR that will implement it? ;) |
I'll give it a shot when I get some time. |
My first pass didn't fly. If I pass the connection from an http server, instead of from a net server, the protocol parser has already read the request from the socket, and the child's handler is never invoked.
Any ideas? |
@thetalecrafter I tried my hand at doing something like this too. I tried some hacky voodoo, in that after the http Server It actually worked too, I had fully functioning req and res reconstructed on the child side. Except the problem is more often than not at the point that you handle a So far it seems that Socket.IO 1.0 is 100% hostile to Heroku. If you have multiple dynos, that'll be broken due to Heroku's lack of session affinity. If you want to compromise and run a single dyno with a few /rant |
Does anyone have a solution for this yet? I would hack it in there myself but I didn't come up with any solution so far. |
I also encountered the same problem,the remoteAddress Always 127.0.0.1,why? |
Since that is the remote address of your proxy from the perspective of your application. |
What is a good solution? |
You all might be interested in my latest pull request: #20 |
add port to part of the hash and you should be fine, even if its behind the same proxy, it'd be different port numbers for different clients |
For anyone stumbling upon this issue, I made a fork of this that solves this issue nicely, along with adding nice graceful shutdown options. https://github.com/binary-person/sticky-session-custom |
Sticky session will always send the connections to a single worker when run behind a proxy, since it does not check the X-Forwarded-For header, and relies solely on socket.remoteAddress.
The text was updated successfully, but these errors were encountered: