-
Notifications
You must be signed in to change notification settings - Fork 63
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
connection.remoteAddress is undefined #7
Comments
See this thread indutny/sticky-session#6 I don't think there is a simple solution yet. I ended up dropping node cluster and spawning workers on different ports and load balancing with nginx. |
Is the problem here that the source address is set in a header by nginx which requires reading data before being able to tell which worker to pass the connection to? |
@elad yes exactly. |
Pull request fixing this issue is open indutny/sticky-session#17, you could look into this to fix your problems. |
I don't like the idea of peeking into a packet and parsing it... :/ |
@elad Then make a better suggestion... At least this is exactly the same thing you would do if you would let make NGINX the balancing or HAProxy instead. It processes all packets, manipulating them and then sending them to node. But you don't send it over the Network Layer again, you just push it back to the read queue. If you really have an Idea that works, I would be absolutely pleasured if you would tell me. As I already pointed out in the pull request, I don't have a problem with getting a packet and parsing it myself. There is nothing wrong with this, but I have a problem with relying on a function which behavior changes regurlarly often. And if there is a possibility that this functionality can be archived easier, this would be great. "If there is any other way to accomplish this, I would be pleased if you would tell me :) |
I don't have a better idea at the moment. Once I have some free time to look into it I hope I will, though. :) |
Closing for the same reason as #15. |
Just interested, when you were "dropping node cluster and spawning workers on different ports", did you start each worker process using a separate command "node app.js"? Or did you use another module to create and manage the worker processes? Also, what is the performance (and reliability)? Thanks! |
Hi everybody,
I'm using nginx as a reverse-proxy and connection.remoteAddress is undefined.
Do you have any ideas how I could get the IP ?
When i'm testing without nginx everything is fine.
The text was updated successfully, but these errors were encountered: