views:

339

answers:

5

I'm looking for a websocket/node.js chat implementation which supports multiple rooms.

I'm also going to write an app which needs multiple rooms or servers, and I'm just looking for some code samples of how people do it.

Thanks.

I know there's a service http://pusherapp.com which provides this service, but I'm looking for an open source example.

+1  A: 

You can take a look at http://orbited.org/ running STOMP protocol (http://stomp.codehaus.org/Home). It has channel support (your rooms). So you just need to send some JSON encoded messages carrying user's nicknames to a channel. I'm not sure how to get the list of channels, might be that you need to track these yourself.

skrat
A: 

I can't quickly answer your question, but I know a couple of open source web chats that have this kind of features:

Maybe you'll find what you are looking for

rds
A: 

There is a really nice tutorial by laktek that shows how to use websockets with node.js. He has also a colaborative code editor that uses redis as a backend of a pub/sub service described here

Nikolaus Gradwohl
A: 

There is this Gist available from Ryan Dahl the author of Node.JS which is a basic IRC daemon written in Node.JS. It is featured in this blog post which describes several IRC related Node.JS programs. Together with websocket this might be an alternative to try out.

The webchat demo (http://chat.nodejs.org/) hosted on the Node.JS homepage is a complete example and the source code can be found in the following GitHub repository and is available under the MIT license.

MKroehnert
A: 

http://github.com/maccman/juggernaut

It was only a matter of time.

*grins.

Thanks OS, thanks maccman, thanks the world.

Mark