Hi,
Take a look at this:
https://github.com/dstpierre/lcsk[
^]
This looks promising. I didn't try that though.
Building a live chat solution looks easy from the surface, but the real challenge will be on the visitor side. Your app need to be compatible with all the major browsers and they are changing all the time. Also, since smart phones are so popular, your chat app should also look good on the mobile browsers.
To show you a sample of commercial grade live chat app, please take a look at
http://www.comm100.com/livechat/[
^](I work for the company). It took us 20ish developers and 6 years to develop a live chat app to this level of maturity.
Reliability will be another issue. Your live chat app should be able to withstand minor network glitches. There should be no missing or duplicate messages. To ensure this, how we do it is from the visitor and operator side, whenever a message is typed in, the client side generates an incremental integer identifier at the client side and tries to obtain another integer from the server. If the client side does not receive the integer from the server, it will keep doing that. This way, there will be no missing or duplicate messages. For example, when the network is down and the client does not receive the integer number, the client send the message to the server again. If the server has not received the message (the client side integer is not on the server side), it will store the message and generate a number for the client. If the server has received the message before (the number from the client side is on the server already) but the client did not receive the confirmation, the server will just ignore the duplicate message and send the previously generated number back.
Good luck with your endeavour. If you have any specific question when you do the programming, I can definitely help you with that.
Best.