0

socket.io in mojito

var sio = require('socket.io');
var moj = require('mojito');
var app = moj.createServer();
var io =sio.listen(app);
io.sockets.on('connection', function (socket) {
      socket.emit('news', { hello: 'world' });
      socket.on('my other event', function (data) {
        console.log('event received from browser'+data);
      });
    });
module.exports = app;

This code is not working nay help ?

by
0 Replies

Recent Posts

in Yahoo! Mojito