Socket.io, Redis Store, and IE

I got the game using Redis, Socket.io, theres 2 nodejs servers running diff socket.io clients. I communicate with both socket.io clients through the redis store, so I can emit all sockets whenever I want. And it works.

io.sockets.emit('successful_connection', { success : true }); return; 

My problem is that when calling a specific socket by id, it fails.

 io.sockets.socket(socketId).emit('successful_connection', { success : true }); return; 

I have no idea why it works in all other browsers. Here is the code to configure socket.io/redis store

  io.configure(function(){ var RedisStore = require('socket.io').RedisStore, opts = {host: **.***.**.**, port: ****}; io.set('store', new RedisStore({redisPub:opts, redisSub:opts, redisClient:opts})); }); 

Any advice would be helpful, right now my main thought is: "Why are there socket.io hosts / servers?". Is there really any benefit if I have to deal with this. Thanks

+2
source share
1 answer

This blog post with sample code may help you.

0
source

Source: https://habr.com/ru/post/1401741/


All Articles