WebChat 2.0 – First release

Due to to many circumstances to mention, the release of WebChat2.0 has suffered some delays; In the meantime most of the desired features (and bug & browser compatibility fixes) have taken place, however a few still remain; As does a healthy dose of nice to have features that will be put in in the future

So because things have been on hold so long i’ve decided to release and open-source what we have so far, as Eric S. Raymond said: “Release early, release often”.The project has been released under the GPL v2 licence.

In laymen terms this means you can do with it what you want, but you have to contribute your changes back to the community / the project, and you can’t just pick it up and sell it integrated into your own projects as if it was your own, integration into other projects is only allowed if you either contact me for a commercial licence, or if your project is GPL compatible too; However using it in your website, intranet, extranet, etc is fully permitted without any problems. I’ve setup a code.google.com project at:
http://code.google.com/p/webchat2/

To check out the project source:
# svn checkout http://webchat2.googlecode.com/svn/trunk/ webchat2

You can download the source of this initial release here:
http://www.chabotc.com/webchat2/webchat2-1.0.tar.gz

Issues can be reported here:
http://code.google.com/p/webchat2/issues/list

And you can contribute documentation and other usefull information here:
http://code.google.com/p/webchat2/w/list

I’m very open to contributions of any kind, so if you need any help to get started feel free to contact me at chabotc@xs4all.nl

Much of the information about this project can be found in the initial post:
http://www.chabotc.com/generic/chat-prototype-first-public-demo/

And the public demo version is still running at:http://www.chabotc.nl:2001/chat.html

Talking of the public demo, its been running without a glitch or restarting the IRC server or PHP daemon for over 3 months, so it seems its quite stable in real life testing.Do be ware, since the project isn’t completely finished yet, it does mean it currently comes without to much of documentation or instalation guides, and some small bugs remain.

And to get it all running you need a number of things:

  • IRC server (hybrid prefered). I used the Fedora Extra’s ircd-hybrid package
  • PHP (developed and tested with 5.2.x) Need to have socket extentions enabled. The demo version is running in a chroot’d envirioment, there’s plenty of guides out there on how to set this up if you need more information about this. Should only be a extra layer of security, since there’s no real potential for code injection, however if you are paranoid about security, this could be a good idea
  • A modern web browser, like IE6, IE7 or preferable Firefox

When configuring your IRC server (which is used in the backend, and guarantees infinite scalability which is tried and tested) a few things are important:

Set the “throttle_time” to 0 or else connections would be denied if multiple people connect at the same time.Then to allow for more then the pre configured users from one IP (standard this is set to 3 or 4 connections). Change:
max_clients
number_per_ip
max_global
max_local

The demo server on chabotc.nl is set to a max of 4096 connections but any number will do as long as your server can handle it.

Also change the “auth” section in your ircd.conf and comment out the following:
/*flags = need_ident;*/

This is because all connections come from your own server, so it only causes delayes when connecting thru the web chat frontend.Then change your network name and description to something fitting, and you should be all set! There’s a lot of other options in the ircd.conf file, but their pretty well documented in the configuration file and there’s plenty of documentation about it on the web.

After this, check out the webchat2 source, change the port number you want it to listen on (currently defaults to 2001) in chat.php, change the server list in htdocs/js/chatConnectWindow.js(!!) you can hide the selection box and make it default to your local server easily there too and change the default channel in httpServer.php (line 78).

After this you should be able to run the daemon:
# chmod +x ./chat.php
# ./chat.php

if all worked well you should be able to connect to your chat setup thru (replace yourhost.com and port number with your local values):

http://www.yourhost.com:2001/

A few wishlist items that are currently high on my list of things to fix:

  • Configuration file for IP’s, port numbers, etc
  • Implement IRC /ignore, /query, /whois, /ping and /help commands in back and frontend
  • Implement double click on nick (in left list) = open private chat window with that person
  • Implement right click menu on nick (in left list) for common options like private chat, whois, etc
  • Few cross browser bugs remain, and smiley’s selection still needs to be made! Much in the same style as color parsing in javascript, it needs to insert the image on click, then on sending the msg rewrite the image tag to the matching smiley sequence, aka “:D” etc, translating these smilies to images again is already implemented

There’s plenty of other items that i left out of the list but those are top priority in my perspective and i’ll be working on them as time permits, but i’m very open to patches too

Javascript, Linux, PHP 31 comments,

31 Responses to “WebChat 2.0 – First release”

  1. Baris Goral says:

    Thanks for the application and the effort. Especially this is important for the usage of phpSocketLibrary, shows us how we can make a php based ajax/comet application.

  2. David says:

    Yea. Thany you very much. I will test it this weekend and if it works many other design students will too…. :-) great work !

  3. Juha says:

    This doesn’t work on opera

  4. Jeff says:

    Doesn’t work in Safari

  5. andy says:

    great job! i love you!

  6. Kosso says:

    incredible work!! congratulations!!

    and there was painfully hacking away at irccgi !! now php goodness in a web2.0 stylee – love it!

  7. tony says:

    chabotc, you wrote:
    Talking of the public demo, its been running without a glitch or restarting the IRC server or PHP daemon for over 3 months, so it seems its quite stable in real life testing.

    How many clients was served during this time (3 months)? How many maximum clients was served concurrently? How do you think can this daemon serve 1000 concurrent clients during this time?

  8. Personally, I think that you should use UnrealIRCd (Because of its wide use) – but i guess thats your option.

    Also… if UnrealIRCd was used, the IP addresses could be changed from the webservers to the real users, using the CGI:IRC login process.

  9. w00t says:

    (there are also patches available for cgiirc auth for other ircds, such as bahamut, and my own ircd, inspircd has a module for it also)

    Spam aside, you should probably implement WEBIRC, or ident/realname/pass encoding like CGI:IRC, otherwise blocking problematic IPs accessing this becomes a little more difficult.

    Didn’t work for me in Opera, did in IE7 and FF2.

    Nice work, I’ll bookmark this one.

  10. Jean says:

    really great .. nice work! i would like to select some channels on a per-url base, like yourhost:2001/channel=testroom

    is this possible with some small hacks? ;-)

  11. LeChuck says:

    Great work, but it doesn’t work in IE6, give me an error “Permission denied”
    IE7 work fine and FF2 too.

  12. Youri says:

    I like it! Way better looking as CGI:IRC!
    I’m just wating for the CGI:IRC login process to be included.
    I like also use this module on UnrealIRCd to see the real IP address.

  13. anycolor says:

    Hi.

    Your code is brilliant – thanks for your work. I adaptated it for my needs, but still trying to solve problem with Opera – WebChat don’t want to work in it :(

    Anyway – u r genius – GREAT JOB!

  14. Youri says:

    I’m running out of TCP ports en memory wile giving everyone his own default channel.

    {quote – Jean} really great .. nice work! i would like to select some channels on a per-url base, like yourhost:2001/channel=testroom {/quote}

    If there is a small hack, please let me know. Are you gonna show us some new work shortly ?

  15. Slotos says:

    I’m trying to use it as a web-interface to community channel and the main problem is that messaging in cyrillic is impossible, while cyrillic messages posted by others are readable. I’m trying to find the reason but I’m lacking skills in php and JS.

    Example of a problem:
    Slotos: нормально отображающееся сообщение
    Slot0s: крякозяблы

    IRC server works with cp1251 encoding.

  16. Slotos says:

    Solved the above problem.

  17. gareth says:

    good stuff. i have a similar project, at http://irc.g00gul.net.

  18. Mandar says:

    Dear sir,

    I have downloaded the source code but how to run it on windows platform. is it suitable for it? I have also downloaded IRC server not a a hybrid one.

    Please help me.

    Mandar

  19. anycolor says:

    I have fixed a lot bugs in the code (made private messaging, fixed smiles inserting and popups in IE, made it cirillic-compatible and so on). If somebody needs such a modification – feel free to contact me to get the code at malkin.stanislav[at]gmail.com

  20. anycolor says:

    any suggestions why it doesn’t work in Opera ? I was trying to fix it – but don’t know where is the problem :(

  21. anycolor says:

    Fixed! All you need guys to fix chat and make it working in Opera, Safari and others is to put line to chat.js:

    window.frames['comet_iframe_name'].location = ‘/get?nickname=’ chat.nickname ‘&server=’ chat.server;

    after line:

    document.body.appendChild(chat.connection);

    And it would be working! Have fun!

  22. PHANTOm says:

    I’ve done some patches (gotta love gpl) which you can find in the website.
    Mainly, when you click a channel in the bar the url of the site updates and you can use these links to autojoin a specific channel.
    I’ve got very positive responses from the users and i’ve gracefully killed cgi:irc in favor of the webchat 2.0
    oh and making smilyfication work is easy (on firefox, still not quite compatible with ie).

  23. pks says:

    please implement the query option with double click over the nick

  24. delishus says:

    Webchat looks great! How many simultaneous users do you estimate it could handle running on the average dedicated server?

  25. Martin says:

    If you google for cgiirc hybrid module, its possible to have each user with their actual host even though this is server side.

  26. aj says:

    Hi. I’ve been looking for a means of sending messages to an IRC chat from PHP. The chatbot seems to come the closest to that capability.

    I don’t suppose you’ve got any examples of sending messages to an IRC room?

  27. yohana says:

    Please Help,

    I have installed the files on the shell, but when i quit the “Putty” , the webchat quit too…

    Please help, what i have to do ?

  28. yohana, just type “screen” in your putty shell and when run the daemon. When you’ll close your putty – the session will be still alive and you can retouch it next time with typing “screen -r”.

    Good luck.

  29. krunchyfrog says:

    hello, I’m trying to set a way to use an external login window for connection. I already got my local server auto-chosen, but the nickname and the automation in chat.js and chatconnectwindow.js don’t seem to like my modifications. Could someone please help me with that? Up to now I got it to print the information I POSTed to it.

    Also, is it normal that I and my users get disconnected after about 1 minute or two?

    Thanks!

  30. Jamie says:

    Hi, could someone please write a detailed install. Thanks

  31. krunchyfrog, you need to restart daemon first, if you made some modification to the server code part.

Leave a Reply