In the directory of your clout-js application, do the following;
- Install this package
npm install clout-socket-io
- Add this module to
package.json
orclout.json
{
...
"modules": ["clout-socket-io"]
...
}
This module inject socket.io into clout and makes use of the express session. e.g.
var clout = require('clout-js'),
sio = clout.sio;
sio.sockets.on("connection", function(socket) {
socket.request.session // Express session is also available in Sockets!
socket.logger // Clout logger are also exposed!
socket.models // Clout models are here too!
});