News for hackers. Stuff that matters.
Re:Nginx now supports Websockets by kevinfat on Tuesday February 19, 2013 @09:00PM (#5248506)
So in practical terms how does one setup backends to use WebSockets. For example, suppose you have nginx in front of a bunch of Unicorn or Rainbow processes and there are two clients that have made websocket connections. Consider a chat application. One of them sends a websocket message and the backend that receives it needs to push the message along the other websocket connection. But how does it know which backend to forward to? What is the intended idiomatic way of maintaining the necessary state?
Re:Nginx now supports Websockets by taylorbuley on Tuesday February 19, 2013 @09:08PM (#5248536)
Think of it like an HTTP request, except a two-way and very long-lived. Not too unlike Comet except with a secure-by-design approach. http://en.wikipedia.org/wiki/Comet_(programming)
Re:Nginx now supports Websockets by kevinfat on Tuesday February 19, 2013 @09:23PM (#5248595)
I've never dealt with Comet. I need the long detailed answer for complete noobs.
Re:Nginx now supports Websockets by jacobolus on Tuesday February 19, 2013 @09:48PM (#5248672)
The old version of that wikipedia article had a bit more background explanation: http://en.wikipedia.org/w/index.php?title=Comet_%28programmi...
Re:Nginx now supports Websockets by kevinfat on Tuesday February 19, 2013 @11:26PM (#5248941)
If I am understanding correctly the suggestion is to have a distributed hash table that any backend can lookup to find the other backend it should forward to. And since the distributed hash table is critically important persistent data I'm assuming that using something like Memcached is not a good idea? What would be advisable instead?