Thursday, November 10th, 2005

“Realtime on Rails” – real time chat using XHR Push

Category: Chat

Martin Scheffler posted this morning on the Ruby on Rails list about a new realtime chat application called Realtime on Rails. If you are using a Mozilla based browser, it will keep open a HTTP connection and push the chat data as JSON. In other browsers the server is polled every five seconds or when you are actively typing.

For more details and the full docs check out Martin’s blog entry, or grab the source (GNU GPL). Or just go to the demo and play around with it – keep in mind its the first release so no guarantees about stability!

The responsiveness in Firefox was very impressive, better then any I’d seen from similiar Ajax chat apps. Very nice work, guys!


Posted by Rob Sanheim at 9:26 am

3.8 rating from 29 votes


Comments feed

Very cool app, and I’m glad you snapped it just after I asked him about building it up to be an editor.

Comment by Bill Guindon — November 10, 2005

Very neat…like the fade ins. Check out as well, it’s an IM chat app that shoots for the same level of responsiveness. Needs to roll out group chat!

Comment by Seth — November 10, 2005

The way it push the content is similar to pushlets (, which can run also on IE.
A great job!

Comment by jparis — November 11, 2005

Have you guys seen Quek ( That is an Ajax based chatbox that has been doing exactly this in both browsers for a few years now. BTW: Try fart, dance and superman :)

Comment by Laurens van den Oever — November 11, 2005

I would prefer the method I used some years ago (yes, Remote Scripting is way older than all of this Ajax stuff) to make a Chat app. When you make a Chat, you need instant notification from the server, so the typical polling is not a good idea, because the user perceives the lag and the server is overloaded for no reason.

Flash has a XML Socket connection available and Flash can be used from Javascript. So you can use a permanent connection with the server to send messages in both directions (server->client and client->server).

By the way, this method can also improve the responsiveness of any Ajax application, because the communication channel is yet stablished and all the stuff of making the connection with the server for each query is avoided. You can send XML through this channel and make the data available to Javascript faster.

Comment by Alsanan — November 11, 2005

Imagine being able to transform your look in two seconds fl at! The latest eyeglass framework let you do just that. But for craze devotee, it’s his adroit-cash act that’s most impressive. Know exactly what you want? READ MORE SUPERMAN!

Comment by superman-tattoo-pics — December 12, 2006

Leave a comment

You must be logged in to post a comment.