Answer the question
In order to leave comments, you need to log in
How to pass id via websocket?
How to pass user id with whom you communicate from client to server using websocket
Answer the question
In order to leave comments, you need to log in
Serialize the message data into a string something like json, simple, universal, convenient, using JSON.stringify and decode JSON.parse.
If the message is complex and contains a lot of data of different types, so that json grows several times, then you can use binary serializers, popular and beautifully implemented - google protobuf ( it was discussed here ) or just compress the channel
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question