Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

gregerolsson's Profile

GitHub User: gregerolsson

Comments by

Avatar

Nice cast! If you're already fronting your webapp with Nginx I can also recommend the Nginx HTTP Push module which is very easy to setup and does pretty much the same thing in this example. Then you can setup locations in your Ngixx conf where you can long poll for messages on various channels and HTTP post to another location from your Rails app, which Nginx will forward to all active connections to the relevant channel.

Easy and very resource friendly on your web server machine.

You can have a public "pull" location but protect your "push" location in the conf so that posting messages need to go through your Rails app, but you can also have public locations for pushing where you wouldn't even need to hit your Rails app to create a shoutbox or something.