socketcluster-client icon indicating copy to clipboard operation
socketcluster-client copied to clipboard

Need help for implemeting a real-time chat

Open jianuovidiu opened this issue 1 year ago • 1 comments

Hi,

I am new to socketcluster and I am trying to figure out how to use it. I would like to create a real-time chat with nodejs socketcluster but I am not able to find any documentation on it regarding how to emit messages from client to server and viceversa.

Any help will be highly apprectiated.

Thank you.

jianuovidiu avatar Jul 14 '22 14:07 jianuovidiu

This page shows how to do it: https://socketcluster.io/docs/basic-usage/

You just set up a for await of loop with a receiver on one side (server or client) and use socket.transmit(receiverName, data) on the other side. The API is the same on client and server. Either can be transmitter or receiver.

jondubois avatar Jul 17 '22 09:07 jondubois