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)


Just visited your chat (therapiek). Really, really great, I didn’t expect it to be very fast but I was overwhelmed by its speed. I’m bowing before you.
It look to be very nice. I could need it. But chat example do not work
I think you make my day
Thanks a lot, Chris , for your efforts!!!
Especially for the phpSocketDaemon!
I recently planned to write one myself, cause I could not
find an appropriate PHP-library to deal with Comet AJAX connections.
I will test and give you feedback!
The Chat demo for me raised an Exception while loading.
I used FF1.5.
->
[...] calling method: [nsIAutoCompletePopup::selectedIndex]” nsresult: “0×8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “JS frame :: http://www.chabotc.nl:2001/js/chat.js :: anonymous :: line 32″ data: no]
Hi Guys, thanks for your intrest!
Yep the server had a temp crash just when i wasn’t looking, its back up again and i’m looking for the bug that caused it … In a days work for a tech demo, i was expecting to find a few flaws in the wild, thats what the testing is for
It should be up and running and working again, if there’s any problems, feel free to ping me here!
Enjoy the demo!
The web chat application looks very interesting!
I could test it only in FF2 (IE7 gave me an error) and I found a problem: if user click on STOP browser button or hit ESC key, the connection with server is lost. I think this can be solved using a timer on client-side that check if the connection exists.
Nice port of the BorderLayout in yui-ext by Jack Slocum. I have been looking for something similar but for Prototype/Scriptaculous.
Thanks Joel.
I hope to make a few more UI components based on this look & prototype, working on the button class right now, and will release those under a MIT license .. prototype defiantly needs more of them!
I’m glad your enjoying the demo
DT: if you ’stop’ the browser, it disconnects the iframe (which is always loading, its what transports the messages real-time), not so much i can do about that in javascript to prevent this … just show a re-connect dialog i guess
Nice job !!
I will take it for a chat on my website. If I find bugs, I will report.
Thanks a lot ! It is awesome
Pretty nice, like the nice clean socket setup, my own project which I haven’t had time to work on lately isn’t as clean but might give you some ideas
Demp
http://chat.cyberlot.net/
and Project page
http://projects.cyberlot.net/trac/flashunity
Watch out for php sockets, I have found steam_socket to be better maintained and more stable then the socket extension.
I think you should name it after yourself, because your last name looks like “chatbots”.
Thanks Eric, i get that a lot
However i promise you that the correct pronouncation of my last name is french, and sounds nothing like chatbots 
Still seeing the many people with the same idea, i would almost start considering it
very cool!
Thank you for phpSocketDaemon,
Chat prototype its best !!!
and source code ???
send source code for me ? jamyl.cb@gmail.com
Tranks
Jamyl
[...] chabotc.nl » Chat prototype – First public demo (tags: ajax chat php comet javascript prototype) [...]
[...] Chris Chabot has recently announced a new chat prototype based on a comet iframe connections for real time messaging, ajax for posting messages and sending commands, prototype.js and script.aculo.us as javascript framework, and bases of the newly written dhtml components. [...]
Great work..seems to work just fine!
Great job!
Any idea when this is gonna be public?
Would be nice so see a public cvs/svn/whatever so ppl could look for the current development status or even contribute.
Use the power of opened sources..
Agree with toph… :]
chris,
do you have some update for us? how is it going?
would be nice to heard something from you
-andy
Really nice design. Just missing the double-click private room option (like it is on CGI:IRC). When typing the message I notice a little more latency (javascript typical) compared with the CGI:IRC and maybe Gmail chat, but of course far less latency compared to the buggy Flash (like Flashchat).
So what is the load/bandwith it consumes compared to CGI:IRC?
CGI:IRC is not allowed by many IRC servers, do you think it would change with this chat?
Thanks
Also, SSL is a must to allow access to the more restrictive firewalls.
Socket daemon is great. Looking forward to the release of this chat app…. (any word on when this will happen?)…. no rush, perfection takes time!
Works very nicely indeed! And btw I’m using IE6 and despite your warnings it works great. Very impressive. I would very much appreciate a full tutorial to how to handle AJAX calls with the PHP daemon.
Keep up the good work!
May I suggest, using the same login process as CGI:IRC as this means that Unreal will be able to show the real users IP address rather than the PHP server, For more information, See the UnrealIRCd/CGI:IRC Documentation.
Thanks
Joshua Davison
Man, im checking this page so often… still no updates… Would love to see a release, even if alpha/beta
pls pls pls
I can only agree with Joshua. This looks so incredibly promising!!! Alpha/beta, anything! Pleeez
Ohh it could start a CGI:IRC vs WebChat 2.0 competition!
Or at least let users to choose between more than one interface!
Continue your work, it could have a long impact on the world.
Waiting with baited breath.
What I have seen here looks MUCH more promising than CGI:IRC, Which is the reason that we are all still here… We want it…. People see it, they want it… This has alot of potential.
Woulld love to see a pre-release.
Just someone else begging for an alpha. Your fans need you! =]
:: Lisa
:: adora [at] techslut [.] net
The site looks great ! Thanks for all your help ( past, present and future !)
hi nice site.
[...] Much of the information about this project can be found in the intial post: http://www.chabotc.com/generic/chat-prototype-first-public-demo/ [...]
Can you please send me source code?:)
Hi Glorybox,
Its publicly available at:
http://www.chabotc.com/javascript/webchat-20-first-release/
I’ll mail you the tarbal of the 0.1 release too though, just in case
hi! chat is nice but its not working with konqueror browser. Konqueror browser is a must for me, i am not willing to change this.
Hi, can i get the source code please?
Hello !
Very nice Applikation!
I tried it, but it dont want
Parse error: syntax error, unexpected T_CLASS in /var/www/******/chat/libs/socket.php on line 13
Does it work onliy with PHP5 ?
Keep it up
BR
Hi.
Good design, who make it?
Hi… I know it’s a long time ago since the last comment, but oh well.. I’d just like to ask you if you could open the demo again? Thanks.
Yes it’s a good idea to reopen the demo.