Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

node.js plugin that handles basic multi-channel messaging.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 support
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json

Simple plugin for node.js/ to enable multi-channel messaging.

I've been reusing this piece of functionality in several apps, so it seems to make sense to break it off into a reusable module


var io = require('')
  , channels = require('')
  , http = require('http');

var server = http.createServer();


var socket = io.listen(server)
  , channel = channels.listen(socket, {})

channel.on('connectedToChannel', function(client, sessionInfo){
    {announcement: sessionInfo.session.username + " has entered the Room"}

channel.on('disconnectedFromChannel', function(sessionId, sessionInfo){
    {announcement: sessionInfo.session.username + " has left the Room"}

channel.on('chat',function(client, msg){
  channel.broadcastToChannel('chat', msg.channelId, msg, client.sessionId)

// you can still use socket as normal, without channels
  // add stuff here...

Check out the included example in the project, for a modified version of the chat example that adds multi-channel functionality. is

  • A 'plugin' for It's meant to live alongside not wrap it completely.

  • Pretty simple to add onto an existing implementation, and turn on per-channel messaging

  • Trying to just add multi-channel message delivery, and stay out of the way to let you do whatever else you want on top of is not

  • Compliant with any standards like bayeux. It's simple and met the current use cases I have.

  • Secure. You need to implement your own authentication or security protocol either by attaching to the events emitted by or

  • Persistent. It provides simple built-in in-memory channel/session storage, with the option of passing another store (i.e. connect-redis)

    (If you're looking for a more full featured multi-channel solution, check out Push-It or Juggernaut)

Questions / Need Help?

I like node and I like making real time/interactive javascript apps, hit me up: (@bsstoner)

Something went wrong with that request. Please try again.