68

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.

Mark
  • 32,293
  • 33
  • 107
  • 137
  • 5
    I'm out of votes for today, otherwise I'd upvote. @Ryan is this question really "unclear or not useful"? Because that's what it says on the downvote button. – Pekka Aug 04 '10 at 20:35
  • 2
    Upvoted, because the question per se is perfectly fine IMHO. Even if the result may be "that's not what you should be doing", which can be instructive in itself. Unfortunately, I have no insight into note.js to offer. – chryss Aug 04 '10 at 20:37
  • 6
    Nothing wrong with this question. – Adam Crossland Aug 06 '10 at 15:42
  • 2
    If we left everything up to a single person/group to do everything that's challenging, there'd be no innovation, no competition, and we'd have a monopoly. So I disagree with Ryan. – jamiebarrow Sep 07 '10 at 09:05

8 Answers8

6

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?

Community
  • 1
  • 1
Shripad Krishna
  • 10,463
  • 4
  • 52
  • 65
2

tested and working great:

https://github.com/mmukhin/psitsmike_example_2

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

Michael Moeller
  • 896
  • 4
  • 12
  • 27
1

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

Daniel Beardsley
  • 19,907
  • 21
  • 66
  • 79
1

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

Matt Kneiser
  • 1,982
  • 18
  • 23
1

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
  • 5,518
  • 3
  • 32
  • 48
1

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
  • 19,708
  • 3
  • 45
  • 61
1

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
  • 3,637
  • 2
  • 34
  • 43
0

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

Mark
  • 32,293
  • 33
  • 107
  • 137