10 ms·
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
by kevinfat 14y ago
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?
- taylorbuley 14y agoThink 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) http://en.wikipedia.org/wiki/Comet_(programming)
- kevinfat 14y agoI've never dealt with Comet. I need the long detailed answer for complete noobs.
- jacobolus 14y agoThe old version of that wikipedia article had a bit more background explanation: http://en.wikipedia.org/w/index.php?title=Comet_%28programming%29&oldid=215165715 http://en.wikipedia.org/w/index.php?title=Comet_%28programmi...
- kevinfat 14y agoIf 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?