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
0
votes
1 answer

Socket.io return callback error when connect using redis adapter

I have created a WebSocket server using socket.io. I have the following code const express = require('express'); const socket = require('socket.io'); const app = express(); app.get('/socketTest', async (request, response) => { …
Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95
0
votes
0 answers

Socket Ids are unstable in the room

When the clients join the room initially for a few seconds they can able to talk but after a few seconds client 1 socket id suddenly drops out from the room and getting new socket id. After that suddenly there is a drop of the socket id of the…
0
votes
1 answer

Socket.io-redis configuration not working

I'm trying to set up socket.io-redis for a kubernetes deployment, but something is wrong with the configuration. It is partially working, in that I can see socket.io messages in redis using redis-cli PSUBSCRIBE, but I don't have access to any of…
Daniel Kent
  • 63
  • 10
0
votes
1 answer

How to scale an application involving many 2-person chatrooms?

Right now I have a word game where users are randomly paired up and send messages to each other. I am using Node.js and Socket.io. Basically, I'm storing the socket.id as the key for an object of users. One of the properties is the socket.id of…
Genoe
  • 13
  • 4
0
votes
1 answer

unable to get data from socket.io-redis with nodejs

Hope you are doing well, As I am creating a multiplayer games, so i need to store all user details from socket, after some time I need to make a group from the Users list. So I tried to implement https://github.com/socketio/socket.io-redis library…
0
votes
1 answer

How to find a user socket in a cluster of socketio processes managed by socketio-redis

I'm new to socketio-redis adapter. Originally I had a single socketio process, but now trying a socketio cluster. When it was a single process, I'd maintain a Map of connected sockets, to find a socket by a userId. When user A emit to a room, if…
1192805
  • 988
  • 2
  • 10
  • 26
0
votes
1 answer

laravel echo listen the socket? not the variable?

queue.blade.php Echo.channel('everyone') .listen('Queue_number', function (e) { console.log('e='+e); console.log('e keys='+Object.keys(e)); console.log('socket='+e.socket); …
robspin
  • 771
  • 3
  • 14
  • 33
0
votes
2 answers

How do i get data from multiple sockets in one node to another socket in another node

Basically my problem is mentioned in the image below at (4) but im trying to retrieve information that is held in sockets in a different node, how do i retrieve data from sockets in a different node?
0
votes
1 answer

Creating remote socket.io client in js format

I am using sockets.io with nodejs server to send/receive events between client and server.It works well on local pc but the issue comes when i have to connect a remote client to it and i dont need to use frontend template file or html. In that case,…
0
votes
1 answer

Socket.io server response with multiple values

I'm using react front end with nodeJs v6 backend, and socket.io-redis pub sub method. the connection is refused by the browser in this case. I've this error: Failed to load…
DarkArtistry
  • 434
  • 1
  • 6
  • 22
0
votes
0 answers

How single user can join mutliple channel using socket.io Rooms?

Client is sending object that contains multiple rooms to join so once socket starts streaming user should see event that are only related to that user based on rooms, So I use socket Rooms approach when event comes i checked if event.room are same…
hussain
  • 6,587
  • 18
  • 79
  • 152
0
votes
2 answers

Including socket.io when compiling assets using Laravel Mix results in error on Windows 10

Trying to work with Broadcasting using Laravel Echo/Redis/Socket.io, with the following versions: node v6.11.3 npm v5.4.2 Laravel 5.4 npm run dev (or production) results in a dependency error where module 'fs' is required, although it was…
Mike T
  • 359
  • 7
  • 17
0
votes
1 answer

Socket.io: How to reduce emit delay with many concurrent connections?

Im running a 4-core Amazon EC2 instance(m3.xlarge) with 200.000 concurrent connections with no ressouce problems(each core at 10-20%, memory at 2/14GB). Anyway if i emit a message to all the user connected first on a cpu-core gets it within…
Mick
  • 8,203
  • 10
  • 44
  • 66
0
votes
0 answers

In socket.io, socket.disconnect() to a single socket, disconnect all socket connection

I have a browser, which connects to server using socket.io with transport as websocket only. I validate all socket connecting to my server, using simple logic and is working fine. Update-1 Now the problem occur when Internet fluctuates, browser is…
0
votes
1 answer

Node.js clustering with socket.io and mysql sessionstore

I'm trying to cluster a node app that runs with mysql, mysql session store and massive usage of socket.io. I was looking for a way to adapt the socket.io session storage in mysql but i only found some redis adapter (following this guidelines :…