node.js multi room chat example

Javascriptnode.jsWebsocket

Javascript Problem Overview


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.

Javascript Solutions


Solution 1 - Javascript

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:

https://stackoverflow.com/questions/4445883/node-websocket-server-possible-to-have-multiple-separate-broadcasts-for-a-sin

Solution 2 - Javascript

tested and working great:

https://github.com/mmukhin/psitsmike_example_2

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

Solution 3 - Javascript

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.

Solution 4 - Javascript

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

Solution 5 - Javascript

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.

Solution 6 - Javascript

Wompt is an node.js multi-room chat server that was recently open-sourced.

Solution 7 - Javascript

Socket.io has support for rooms. This link helped me implement them in a matter of seconds.

https://github.com/LearnBoost/socket.io/wiki/Rooms

Solution 8 - Javascript

http://github.com/maccman/juggernaut There's this one, only for ruby though.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMarkView Question on Stackoverflow
Solution 1 - JavascriptShripad KrishnaView Answer on Stackoverflow
Solution 2 - JavascriptMichael MoellerView Answer on Stackoverflow
Solution 3 - JavascriptskratView Answer on Stackoverflow
Solution 4 - JavascriptNikolaus GradwohlView Answer on Stackoverflow
Solution 5 - JavascriptMKroehnertView Answer on Stackoverflow
Solution 6 - JavascriptDaniel BeardsleyView Answer on Stackoverflow
Solution 7 - JavascriptMatt KneiserView Answer on Stackoverflow
Solution 8 - JavascriptMarkView Answer on Stackoverflow