Questions tagged [socket.io-redis]

Adapter to enable broadcasting of events to multiple separate socket.io server nodes.

By running socket.io with the socket.io-redis adapter you can run multiple socket.io instances in different processes or servers that can all broadcast and emit events to and from each other.

If you need to emit events to socket.io instances from a non-socket.io process, you should use socket.io-emitter.

See also

Installing:

$ npm install socket.io
112 questions
1
vote
1 answer

Socket.io not working when using multiple nodes through pm2

I have NodeJS application running with Socket.io for real-time updates. I am using PM2 process manager for production Node.js application. Now I want to use cluster mode in PM2. As nodejs applications runs in single process, I want to utilize max…
Prem popatia
  • 321
  • 3
  • 14
1
vote
0 answers

SocketIO Presence System Redis

I'm building a presence system for live streaming using Socket.IO with Redis, with load balanced instances. Everytime the user enters a room, I send to the server a socket.emit('join', roomId) and the server joins the user to the corresponding…
Nikolas L.
  • 545
  • 3
  • 7
1
vote
1 answer

socket.io + socket.io-redis adapter method calls timeout

I have recently upgraded from Socket.io 2.x to 3.0.3 and use it with socket-io-redis@6.0.1. As per explained in the original migration docs, I'm trying to get a list of all the open sockets with: const ids = await io.allSockets(); This results in…
hmt
  • 69
  • 7
1
vote
0 answers

Nginx Socket.io nodejs memory leak

We use nodejs(express) and nginx and when we turn on socket.io the memory usage increases too fast and not going down in 1 hour + 1GB, one day full memory leak 12GB and my server freezes. I tried to turn off socket.io and it starts working normally…
Orgil
  • 81
  • 2
  • 4
1
vote
1 answer

Socket.io-redis gives error when added as adapter to Socket.io instance

Im experimenting abit with Socket.io and Socket.Io-redis. I have my Redis server up and running. The error i get when starting the Socket.Io server is: ReplyError: ERR unknown command 'pubsub' I dont know why i get this error at all. The Redis…
Knut
  • 11
  • 2
1
vote
0 answers

Laravel echo with Laravel passport auth

i try to create private chat,but on connection i get:enter image description here my laravel-echo-server.json: { "authHost": "http://localhost", "authEndpoint": "/broadcasting/auth", "clients": [ { "appId": "id", "key": "key" …
1
vote
1 answer

i am unclear of how to use socket.io-emitter (server to server)

Below is how i initialize and emit but i dont find any errors nor do my server listening, receives any events. const io = require('socket.io-emitter')({ host: 127.0.0.1, // path: do i need this ? port: redisUri.port, pub: pub, // is the key…
DarkArtistry
  • 434
  • 1
  • 6
  • 22
1
vote
1 answer

Socket events are firing multiple times on switching the states in AngularJS application

I am connecting Angular JS application having multiple states(Routes) with Node server(Socket) running on back-end. When I visit some other state and come back to the state where socket code is written, it again gets registered and when an event…
1
vote
1 answer

socket.io get all rooms with number of clients connected

I am now using socket.io with multiple nodes hence I started using the socket.io-redis adapter (https://github.com/socketio/socket.io-redis) to help me sync between nodes. I would like to get a list of all the rooms on the server and a corresponding…
user2924127
  • 6,034
  • 16
  • 78
  • 136
1
vote
1 answer

Push to talk - How to manage push button in socket.io

I have two servers where socket.io is hosted , communication between two apps are managed with redis. When user 1 click on push button , on server side in redis, I am making entry as Room:A -> User1 When user 2 click on push button, he get room…
Furqan Misarwala
  • 1,743
  • 6
  • 26
  • 53
1
vote
1 answer

Unhandled rejection Error: Integer is unsafe

Sometimes I am getting the error 'Unhandled rejection Error: Integer is unsafe' when sending JSON data via socket.io 2.0. Here is an example of sending a tweet object that results in such an error. Example…
Stan Wiechers
  • 1,962
  • 27
  • 45
1
vote
1 answer

socket.io-redis module not working across servers

Hey guys I'm trying to implement the socket.io-redis module as per the socket.io-redis documentation. It works fine when broadcasting messages from one client to another client on the same server. But when I run two identical servers, one on port…
1
vote
1 answer

Emitting events to socket.io from PHP

Hi I'm trying to emit events from PHP to a socketio server. I've tried both these forks: https://github.com/rase-/socket.io-php-emitter https://github.com/ashiina/socket.io-php-emitter PHP code:
Jonathan
  • 543
  • 9
  • 23
1
vote
1 answer

Laravel echo, socket.io, and laravel-echo-server won't work

This is probably the most frustrating thing I have ever encountered, sadly it's probably something stupid that I did. Here are the links to the three things that I'm using: Laravel Echo Setup Socket.io (cdn) Laravel Echo Server Here is my problem:…
Dastur
  • 684
  • 6
  • 23
1
vote
0 answers

How to get all sockets connected on 2 different nodes through socket.io-redis?

I am connecting sockets to port 8100 and port 8200. Both of them are using socket.io-redis module to share sticky sessions, How do I get the total number of connections I have on the website?
Hardeep Mehta
  • 469
  • 1
  • 6
  • 17