socket.io-chat-fargate
socket.io-chat-fargate copied to clipboard
Users online with multiple servers or containers ... works fine?
In your code... the number of users conected on the socket, are calculated based in users connect on socket connection... this is correct ? Please tell me if i am wrong, but, in your code , when this project is deployed to a cluster with a load balancer... using sticky sessions, the total number of users conected, not working properly, right ?
The correct way, would be get the total number of users connected from dynamodb or redis, for example, no?
Thankyou! (sorry my bad english)
Yes, @felipemarques you are right, take a look at this branch: https://github.com/nathanpeck/socket.io-chat-fargate/tree/4-scaling here, he used a lib called presence.js
. It is used to get the total number of users connected from Redis.