node.js multi room chat example

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.


I realized that you have not yet received a solution to your issue yet. Suggest looking at this question where i have provided the answer:

node-websocket-server: possible to have multiple, separate "broadcasts" for a single node.js process?


tested and working great:

https://github.com/mmukhin/psitsmike_example_2

(node.js and socket.io multiroom chat tutorial with 17 stars on github)


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.


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


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.