Answer the question
In order to leave comments, you need to log in
What is the best architecture for chat design?
Don't scold me for extra tags, please. Smart and experienced people listening to these tags were the reason))
Answer the question
In order to leave comments, you need to log in
I didn't understand much from your story. you can do everything quite simply:
The client opens a connection to the server and does the following:
1. sends his messages (if he wrote something) and actions
2. receives the messages that the server sent him. (Addressed to him in a personal, or to the channel / channels that are active with the client at the moment).
The server keeps connections with all active clients. Receiving messages from them - sends them to subscribers.
End.
It seems like the node has become synonymous with chat for a long time. I don’t see communication problems there 1k people, web sockets will definitely pull, where I can’t even imagine the reverse infa.
In general, it's trite to read the documentation https://socket.io/
I think at the start to get a list of all channels and create only one connection. At the same time, send the channel name/ID and message from the server, look at the name/ID on the front and push the message to the desired room. In principle, he said everything the same as Stalker_RED
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question