How does this work for non-socket transports? You have to be saving the broadcasts in case someone is polling, right?
I'm not sure what you mean by "saving the broadcasts". Can you give an example?
Some 11% of clients are using XHR or JSONP protocols and it it Just Works(tm), I did not add anything special.
- client opens a page on HAProxy load-balancer picked server
- the actual node server that receives the request, redirects the browser to its custom hostname using the same URI
- client opens the same page on the particular server and socket.io connects to that subdomain
This ensures that all future requests (if socket.io connection is broken) will go to the same server without Redis, MemoryStore, cookies or whatever.
Drawbacks:
- one additional HTTP redirect when page that contains socket.io is loaded (luckly, in games there aren't many of those)
- if you want to retire some sub-domain hostname, you have to be careful to allow existing clients to re-connect somewhere else. Not really a problem for my setup, but YMMV.