--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
> So is the only solution that's going to keep the connecting IP going to be using Apache for load balancing and SSL termination?
No, another solution is HAProxy for balancing and stud for termination. This combination is by far better, if you expect thousands of connections.
stud
will optionally write the client IP address as the first few octets (depending on IPv4 or IPv6) to the backend--or provide that information using HAProxy's PROXY protocol.
Oooh. Done!
Though stud can write the IP info, as far as I can tell there's still no way to pull that out on node without building your own version of node that supports a pre-parse event before passing the stream to the HTTP parser. This is a pretty simple change and is what we do, but does require our own deployment of node.
Also of note, until 3 days ago, to get stud to *read* the PROXY line with the IP address coming from HAProxy also required a version of stud other than their master one, but it looks like they finally merged one of the outstanding pull requests to add that, so you can use the --proxy-proxy option to pass the IP from HAProxy through stud.
Good to know. I probably don't need it on the node side though. It's mostly just for logs, which stud can write. Am I missing a need for the real IP in node?
--
Great choice. BTW. Have you found a way to dynamically bypass nginx when you detect an upgrade to a websocket connection?
That is a great idea. Thanks for the details.