You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
First change app.js (in root of calipso) as follows:
var socket_io=require("socket.io");
...
// within express.boot() function
if (app) {
var server=http.createServer(app); // socket.io requires access to http.Server object.
var io=socket_io.listen(server);
app.socketIO=io; // You need to access this object from modules as calipso.app.socketIO
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).
calipso.app.socketIO.sockets.on('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 socket.io client code in one of the module templates.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am exploring use of socket.io 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 socket.io, as given here: http://www.danielbaulig.de/socket-ioexpress/. This needs some exploration. )
First change app.js (in root of calipso) as follows:
And within the module, use this code. I presume this should be in the route handler code (as opposed to init).
And you will also need to put in the usual socket.io client code in one of the module templates.
The text was updated successfully, but these errors were encountered: