Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Using ... #175

codevin opened this Issue · 0 comments

1 participant


I am exploring use of directly from a module. This seems to work, and these are instructions if you want to try.

(However, the sessions need to play well with, as given here: This needs some exploration. )

First change app.js (in root of calipso) as follows:

var socket_io=require("");
// within express.boot() function
     if (app) {
          var server=http.createServer(app);  // requires access to http.Server object.
          var io=socket_io.listen(server);
          app.socketIO=io;  // You need to access this object from modules as
          var out = server.listen(port, function () {

And within the module, use this code. I presume this should be in the route handler code (as opposed to init).'connection',  function(socket) {
     socket.emit('news', <<data object>>); // send something to client.
     socket.on('flag', function(data){...} ); // receive something from client.

And you will also need to put in the usual client code in one of the module templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.