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

How to develop live chat using node js

I want to develop live chat using node js. Can anyone guide me how to do this? The use cases I decided : User will see a link or icon on the app screen labeled ‘Online chat support’. Clicking on this, chat window will open up. Either it will…
1
vote
0 answers

How to join socket.io to common room in server side?

I have next code on client: Socket.notif.to(eventNameListen[i]).emit('public', { channel: eventNameListen[i] }); What code must be on server side, that will add current user to room eventNameListen[i]? I tried: socket.on('public', function (data)…
Ahmed
  • 255
  • 1
  • 6
  • 18
1
vote
1 answer

questions about socket.io adapters

I am currently working on a node.js-based socket.io service that makes use of the node.js cluster module to spawn several node.js processen on the same machine. The socket.io docs say that it is required to use an adapter if multiple processes are…
muffel
  • 7,004
  • 8
  • 57
  • 98
1
vote
0 answers

Step by step instruction to create multiport socket.io server using node.js

can someone help me with step by step instruction about creating multiport socket.io node.js server? My current situation, I have 1 server of socket.io node.js with 1 port to serve hundreds of client. For about 1 year, the number of users connected…
Dika
  • 2,213
  • 4
  • 33
  • 49
1
vote
0 answers

Socket.io with redis store emits events in the callback function consume of AMQP

I want to use nodejs server to receive messages from AMQP, then push those messages to web page through socket.io with redis. The emit() function is invoked in the callback function consume of AMQP, and web UI can get those data. However, I can NOT…
zangw
  • 43,869
  • 19
  • 177
  • 214
0
votes
0 answers

using @socket.io/redis-adapter with pm2 in cluster mode on ec2 instance

I am trying to run my node.js application that uses socket.io on a linux ec2 instance using pm2 in cluster mode, when I run my application using pm2 start /var/www/html/backend/index.js I am successfully able to create a connection with my server…
0
votes
1 answer

Getting missing 'error' handler on this Redis client even after giving error handlers

I am working on to integrate redis, @socket.io/redis-adapter, socket.io and express-session. The following is the code : // Promisify the methods so we can use async / await with redis bluebird.promisifyAll(redis); const redisClient =…
reciever
  • 69
  • 2
  • 11
0
votes
1 answer

ReferenceError: queueMicrotask is not defined at RedisSocket.cork

I'm running Node JS with express using socket.io to connect redis server. Starting the application on command line works perfectly but when i register the application with Application Manager via CPanel and i tried opening the url on browser the…
0
votes
0 answers

TypeError on socket.io adapter

For using multiple nodes in my socket.io as part of expanding I used the Redis socket.io adapter @socket.io/redis-adapter. The transmission of data/messages between sockets on different nodes works fine on the cluster mode. When trying to fetch the…
0
votes
1 answer

How do I join a socket io room AFTER a redis subscription event happens?

I'm using redis pub/sub and I want to join a room after the redis sub event: const express = require('express'); const app = express(); const socketio = require('socket.io'); const redis = require("redis"); const expressServer = app.listen(3001, ()…
Kyle Corbin Hurst
  • 917
  • 2
  • 10
  • 26
0
votes
1 answer

Cannot read property 'EVENT' of undefined at Namespace.emit

I'd upgraded my socket.io version from 2 to 3 but the below line: io.sockets.in(room).emit(bag.message.eventType, message) breaks with this error: Cannot read property 'EVENT' of undefined at Namespace.emit…
Abhishek
  • 539
  • 5
  • 25
0
votes
2 answers

Socket.io fetchSockets() error between redis nodes

We are having issuses using server.fetchSockets() in socket.io redis nodes. When a server call this function the others servers are throwing this exception: C:\path\node_modules\socket.io-redis\dist\index.js:212 response =…
D.Pacheco
  • 520
  • 6
  • 24
0
votes
1 answer

socket io connected without on connection event on server side (GKE)

I deployed a Socket.io based app in GKE. I already use Redis adapter to handle multiple pods. Cookie affinity already set in Ingress setting. I use dynamic namespace. I ONLY USE 1 POD on GKE. When I scaled from 1 pod to 0 pod, then to 1 pod again,…
0
votes
1 answer

how to access socket session in all clusters

I am working on setting up socket.io in cluster mode using PM2. I am using socket.io-redis package and it works fine in cluster mode. But the problem arises when I want to access all connected sockets. Because processes don't know about socket…
0
votes
1 answer

How to debug laravel-echo-server? Laravel 8 Redis Broadcasting

After create an event and sending it to Redis, I try to subscribe to the event and I make a request to laravel-echo-server, via socket.io in a Vue component. window.Echo.channel('chat') .listen('Message', ({message}) => { …
webgrig
  • 49
  • 1
  • 8