Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



My little weekend project (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.


If it does require sticky sessions, it will not work with more than one dyno: https://devcenter.heroku.com/articles/heroku-labs-websockets...


It 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-Soc...


I'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

"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."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: