It’s my distinct pleasure to be able to announce the first public showing of a project that I’ve been working on in my spare time in the last month or two, a new Web Based IRC chat application.
This project brings together a lot of new technologies which had to be developed to make this a feasible, scalable and efficient.
Some of the underlying tools build to make this posible that i consider ’stable enough’ are already released, such as the php Socket Daemon library i wrote to be able to deal with hundreds up to many thousands of “Comet” http connections, and an equal amount of IRC client connections.
Also the javascript to parse the mIRC color codes is already available, also this web site of things relies solely on prototype and script.aculu.us, plus from the ground up implementations of tabs, windows, tooltip, context menu and channel components based on prototype (all to be released soon, together with the main app).
The main application its self will be open-sourced as soon as a few more visual features are finished (such as a context menu to have a visual interface to commands like whois, op, voice, topic, etc..These commands have already been implemented by typing things like: /op NickName, or /topic My New Topic, etc, but they still need a good, usable and attractive interface before the ‘average user’ will understand what and where they are.
Demo
To stress test the framework, and find any bugs that can only happen in the wild, I’m making the current version available as a preview to what is still to come, please feel free to play with it, and leave your comments, compliments and/or bugs reports here
* Please note only Firefox (1.5 & 2.0) and IE 7 have been tested, IE6 and opera still have some problems, which are planned to be addressed shortly. Until then i would strongly recommend using Firefox, in general this is a good idea actually
How to use
When you enter the application you will see a login dialog, enter a valid nickname here (and try to make sure its unique), and select a network to chat on. Currently 2 networks are supported: Local, which is a IRC server running on this server, which allows up to 4096 connections, and ‘EFNet’ (one of the worlds largest irc networks).
EFNet servers however only allow upto a max of 2 or 4 connections from one IP (as is the case with this chat, all connections come from the server), so it tries to pick a random server out of a pre-programmed list. However these slots will fill up quickly, so if your connections fails refresh the page, and try again.Connecting to EFNet takes longer then the local network too, this is due to the identd timeouts those servers maintain, please be patient while its connecting.
Commands
The join channel dialog has already been finished (click the + tab in the upper left corner), however most commands and functionalities don’t have a visual interface yet. However they do have ‘IRC’ style typed counterparts that allow you to use them. These are:
- /join #channel
- /part
- /op Nick
- /deop Nick
- /voice Nick
- /devoice Nick
- /nick newNickname
- /topic Some channel topic
- /invite Nick
- /whois Nick
- /whowas Nick
- /msg Nick some message
- /tell, /privmsg, as same /msg above..
- /quit
Technology
The chat application consists out of a few separate components:
- Socket daemon library
- HTTP daemon implementation (for the streaming comet connections for server to client communication, and dealing with the ajax requests for client for the client to server communication)
- IRC Client implementation (which exchanges the events and messages with the comet http connection, and receives the user’s commands and messages)
- The web application its self, which is implimented using prototype.js and script.aculo.us
A comet implementation was needed to provide real-time, fully async messaging, see this figure for an overview of the different application communication paradigm’s:

The colors and some graphics were borrowed from yui-ext, a unique look is in development, and i hope to have an alternative theme available at release.
When is the public release?
Ohhh i know the answer to this one: “When its done!”, in all seriousness though, i expect to have a few more good weekends and some of the Christmas holiday left to work on perfecting and finishing this, and your testing will help greatly with that!So expect a final release in early 2007. when it will most likely be released and licensed under the GPL (GNU Public License)Thanks to anyone who will is willing to help test this application, i’m looking forward to your feedback!
Other irc web chat projects
There’s only one viable other option i’m currently aware off, the widely used CGI:IRC (written in perl), however it’s not nearly as full featured, easy to use or scalable as this project
Interview
Ajaxian.com talked to me about this project, and asked me if I could share with them the biggest challenges: the Ajaxian article in which I replied to them:
The greatest challenge writing this was to make it scale up, and keep IO in check. The orignal plan was to layer out the http, irc and comet components, but the overhead of sending all the event trafic over local loops/connections when dealing with hundreds to thousands of connections, is just to much. All the memory bandwidth used would then be multiplied 3x, which was just a to high of a strain on the system.Second challenge was that there were no decent comet implementations available (except for dojo’s which i used as a reference), and there was definitely a challenge that there were no PHP (my preferred language) libraries or tools available which could deal with a large amount of always-on connections, even fast-cgi with something like lighttp just wouldn’t scale to hundreds of live connections, and the memory needed would be horrendous, hence the new php socket daemon library was born, its a riskier model, if the program has a fatal crash (great care was taken to avoid this) the service has to be restarted again (happens automaticly), loosing the client connections in the process, however it now only takes 15Mb of memory under moderate load, and guarantees responses in under 0.15ms, something that would be unfeasible with a clasic apache/php situation.Also most of the heavy lifting (such as link and color parsing, etc) has been lifted to the client, it would be way to heavy for the server to do all of this, and still be able to scale upLikewise the javascript side of things took a bit of trial and error too, some channels can have thousands of messages, and hundreds of members, so browser speed has defiantly been an thing to optimize too.Lastly the back-end uses a plain old IRC server, which is almost infinitely scalable, just add a server, link the IRC servers together, and run another web chat back-end on it, repeat ad infintum.. (irc networks are known to have many hundreds of thousands of people connected, using this as the backbone of the messaging provides guaranteed scalability)

