4 ms·
Is it possible to use something like Socket.io that falls back to long-polling on older browsers? The biggest problem I've had with Socket.io on PaaS's is it p
by tlrobinson 13y ago
Is it possible to use something like Socket.io that falls back to long-polling on older browsers?
The biggest problem I've had with Socket.io on PaaS's is it pretty much expects every request from a particular client to be routed to the same backend (i.e. sticky sessions), which works ok with a single backend but obviously doesn't scale.
Given Heroku's stateless routing architecture, I'd guess no, but maybe there's something I'm missing?
- bgentry 13y agoIf it does require sticky sessions, it will not work with more than one dyno: https://devcenter.heroku.com/articles/heroku-labs-websockets#process-and-application-state https://devcenter.heroku.com/articles/heroku-labs-websockets...
- friism 13y agoIt looks like socket.io has a `RedisStore` that you can use on loadbalancing setups without sticky sessions (like Heroku): https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Soc...
- tlrobinson 13y agoI'm not sure that solves the sticky session problem, I think it may just be for broadcasting to channels. See the last line of this answer: http://stackoverflow.com/a/9275798/113 http://stackoverflow.com/a/9275798/113 "A potentially big drawback with this is that socket.io sessions are not shared between workers. This will probably mean problems if you use any of the long-polling transports."
- philipnuzhnyy 13y agoMy little weekend project (http://chatzilla.herokuapp.com/ http://chatzilla.herokuapp.com/) that I put on Heroku a few weeks ago uses socket.io with Flask, gevent and socket.io would automatically fallback to XHR polling. Using socket.io is great for these cases since it's all done automagically.