clout-socket-io
v0.4.0
Published
Clout module to leverage socket.io
Downloads
6
Maintainers
Readme
clout-socket-io
Install
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"]
...
}
Usage
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!
});