Take the 2-minute tour ×

I am considering making a chess app in Rails where moves need to be pushed from the server to the client browser asynchronously (ideally with websockets).

However, from what little research I've done it appears that Heroku does not support websockets. But there is an alternative in using socket.io configured to use long polling instead of websockets.

Is long polling insufficient to achieve latency requirements for something like a 5 minute blitz game of chess?

share|improve this question
As closest alternative you can use pjax, which kinda similar to websockets, however there are lots of things, you have to do to make it work as intended –  sanny Sin Feb 16 '13 at 10:39

2 Answers 2

up vote 1 down vote accepted

The Heroku Cedar stack supports HTTP Streaming and Long Polling: https://devcenter.heroku.com/articles/request-timeout#longpolling_and_streaming_responses

It doesn't support WebSockets. But you can use a framework like Faye and use XHR as the transport mechanism. It seems there's a project for this. See: Is it possible to host FAYE, on Heroku?

If you want to use WebSocket in your game client and have your backend on Heroku then the only solution that I know of right now is to use the Pusher (who I work for addon): https://addons.heroku.com/pusher

share|improve this answer
addons.heroku.com/pubnub is another option. –  Ethan Jul 8 '13 at 23:35

An alternative that's much closer to Websockets is Server Sent Events. It's one-way from server to client (you can just keep making standard requests for the client->server direction).

Heroku does appear to support Server Sent Events, as do most browsers that support Websockets (IE10 being the exception that doesn't).

share|improve this answer
user782220, Heapy 's point is correct. You can get pretty much the same behaviour with xhr polling. I would expect that in the not so distant future they will also offer websockets and then your application can switch to it (just my guess!). Your users will not notice the difference when you switch over. –  Dimitris Apr 13 '13 at 19:18

Your Answer


