Session middleware for your bus.io apps

Session middleware for bus.io that uses express-session.

var bus = require('bus.io')();
var session = require('bus.io-session');

The underlying component is socket.io-handshake.
Which means this middleware component accepts the same configuration options. Here is a complete example.

var expressSession = require('express-session');
var RedisStore = require('connect-redis')(expressSession);
var sessionStore = new RedisStore();
var cookieParser = require('cookie-parser');
var session = require('bus.io-session');
var bus = require('bus.io')(3000);
bus.use(session({store: sessionStore, key:'sid', secret:'secret', parser:cookieParser()}));

Installation and Environment Setup

Install node.js (See download and install instructions here: http://nodejs.org/).

Clone this repository

> git clone git@github.com:turbonetix/bus.io-session.git

cd into the directory and install the dependencies

> cd bus.io-session
> npm install && npm shrinkwrap --dev

Running Tests

Install coffee-script

> npm install coffee-script -g

Tests are run using grunt. You must first globally install the grunt-cli with npm.

> sudo npm install -g grunt-cli

To run the tests, just run grunt

> grunt spec