Skip to content

Tag: socket.io

disconnect client from socket.io id

I can connect specific player to specific room like: And documentation says that ‘you can use leave method to leave room’ like: But I just want any client to leave using io object instead of socket. I need something like: Is there any way to leave client from room using just socket id with io obje…

Socket.io error hooking into express.js

I’m trying to hook socket.io and express.js together: At the line: var io = require(‘socket.io’).listen(app); I’m getting an error: There doesn’t seem to be anything on SO/google about this error… Answer You can do it without using http module app.listen return a server ins…