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;

I am trying to use the above code , but it is not working ........... Socket server is never started. any help ??? 
Please let me know if it is not possible to integrate with socket.io  , i can just use plain express with out mojito

0 Replies

Recent Posts

in Yahoo! Mojito