Skip to content
Advertisement

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 object? Answer As @tresdin mentioned,

Client Socket.io disconnects and reconnects to websocket persistently

I am connected via Socket.io 1.3.4 (via websockets) to the NodeJS server and client socket.io fires up “disconnect” event 5-30 seconds. Every “disconnect”->”reconnecting”->”reconnect” iteration takes approx. 2 seconds. I am connected via cable to pretty stable network. Server is hosted on AWS. Sometimes I have bad Wi-Fi connection, but no “disconnect” event fire up at all. How can I debug

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 instance you can use for socket.io

Socket.io not sending cookies in the handshake causing the request to stall

Let me explain my setup. I have multiple domain names that are all CNAME records for a main domain name, such as example.com. example.com -> serverIP company1.example.com -> example.com company2.example.com -> example.com I’m basically developing white labeled versions of our software, where the software simply detects the referrer and knows which logos and stylesheet assets to load. So that is

How to add rooms in Node.js with Socket.io?

I have been following up many articles to learn making chat application with Node.js and Socket.io. Everything is clear and I can make an application moving messages from client to server and emitting to all etc but only one thing is not clearing and cannot figure this out. How can I add rooms to io.sockets.manager.room? What is the code to

Advertisement