Rewrite: To establish a connection with a Socket.IO server, specify the desired path and namespace.
86👍 When setting up your server, be sure to specify the path: var io = require(‘socket.io’)(http, { path: ‘/myapp/socket.io’}); io .of(‘/my-namespace’) .on(‘connection’, function(socket){ console.log(‘A user connected with ID %s’, socket.id); socket.on(‘my-message’, function (data) { io.of(‘my-namespace’).emit(‘my-message’, data); // Alternatively, you can use socket.emit(…) console.log(‘Broadcasting my-message’, data); }); }); When connecting from the client, make sure to … Read more