IM/Chat over HTTP without browser plug-ins
Friday, August 12th, 2005The past couple of months I’ve been pondering an idea. It isn’t a new one, or anywhere close to groundbreaking, but I don’t think anyone has accomplished anything quite like it before. I want to write an IM/chat system that is as responsive and real-time as native IM/chat programs, and that operates solely over HTTP, with vanilla browsers – no Java applets, no ActiveX plug-ins, just Javascript that all modern browsers support. The advantage of such a system is that it could traverse firewalls and proxies traditionally used to block users from using IM/chat, and that users would never be prompted to install applets or plug-ins that many users distrust (for good reason too).
So, why hasn’t it been done before? When I first had the idea I thought surely there would be at least 10 similar projects already. I found several attempts, but none seemed to fit the bill – some communicated entirely over HTTP but required Java applets, some didn’t use any applets or plug-ins on the client but weren’t responsive or real-time (updates were polled for ever 2 secs or so). Looking at the current field of attempts there seemed to be a couple of challenges that I would have to find a way around.
- HTTP/1.1 supports keep-alive connections, but they don’t work well for 2-way communication. The client still must initiate every exchange, so the server can’t send messages to the client on demand.
- A client repeatedly polling a server for messages (even when there are none for it) puts a lot of unnecessary load on the server, and generally results in a poor user experience. The programs I looked at that used this model often felt very laggy and sluggish – they certainly didn’t feel like native applications.

Iveyrock's blog