B
B
bernex2015-12-28 21:35:39
Node.js
bernex, 2015-12-28 21:35:39

How to use websockets on node. js?

Let's allow 8 node instances to have websocket connections, how to send change messages to everyone if the instances are different? Servers?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
yeti357, 2015-12-29
@yeti357

within a node cluster - using the worker.send() method
within multiple servers: a pubsub would most likely need to be set up. Redis, various *MQs, that's it. a bunch of options

A
Andrey K, 2015-12-29
@mututunus

Redis pubsub used.

K
kolesnevg, 2015-12-29
@kolesnevg

I used socket.io in production, or I don’t know how to cook it .... or the skis don’t go
, sometimes the messages didn’t reach the users, and the restart helped
, eventually spat and installed the nginx push stream module, 2,000 online, the flight is excellent

V
Vladimir Kozhin, 2016-01-07
@affka

I use Redis pubsub, but I need to implement the logic myself (though not for long). Socket.io runs out of the box through redis pubsub.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question