Finishing Socket.IO

We have built many little Socket.IO demonstration applications, and now is the time to create the Socket.IO we are going to use. We only need to update the authorization and connection functions. Let's get started. Open up index.js present in the socket.io folder and make the following changes to the require statements at the top:

var io = require('socket.io'), cookie = require('cookie'), cookieParser = require('cookie-parser'), expressSession = require('express-session'), ConnectRedis = require('connect-redis')(expressSession), redisAdapter = require('socket.io-redis'), redis = require('redis'), config = require('../config'), redisSession = new ConnectRedis({host: config.redisHost, port: config.redisPort}), redisChat = require('../redis/chat'), ...

Get Building Scalable Apps with Redis and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.