This is a collection of commonly used middlewares for Socket.IO, which I wish Socket.IO was bundled with. Socket.IO-bundle is based on Express middlewares, so that you can easily integrate with Express and Connect.
var bundle = ;var server = ;var io = server;io;io;io;server;
Arguments for each middlewares are completely the same with Express's ones.
You must be aware of that
session middleware can’t set cookies to clients due to the behavior of Socket.I.
Csrf tokens will be supplied to browsers via Express/Connect, and be sent to a Socket.IO server as a query parameter.
// clientvar socket = ;