Search code examples
phpjavascriptnode.jschatcomet

Instant Message, Chat Room - for LAMP


I'm looking into adding a chat feature on my site (it's somewhat like a social network). The 2 things I'd like to support are:

  • "instant message" - similar to what FB and GMail provides, wherein 2 individuals can chat in real time
  • "chat room" - where a group of people can chat together (with the option to allow individuals in the chat room to private message each other -- and to be able to turn this feature on or off). Web cam support needed, too.

If I were to try to implement something like this on my own, I think I'd have several options on how to implement this:

  • Ajax long polling (probably the easiest)
  • Comet/Reverse ajax (means I need a push server like Ape, which is more complex I think)
  • Web sockets (but then I'm limited to HTML5)
  • NodeJS (don't really know enough about this)
  • ???

Then again, in the interest of saving money and getting this feature implemented ASAP, perhaps I'm better off trying to use a commercial package, such as http://www.arrowchat.com/. Problems I see with Arrow Chat are:

  • It's not JSLinted (and they have no plans to do so)
  • The ability to turn "PM" feature on/off is not supported

Everything else about Arrow Chat seems fine, though.

There is also http://www.cometchat.com.

Any suggestions on what direction I should take? Were the technologies I listed correct should I try to implement this on my own? Are there any other commercial chat software I should consider?


Solution

  • You don't need to implement all the transport layers on your own. You can either try Socket.IO, which abstracts that away or you can use a service such as Pusher.