Identification of the websocket connection. How?

There is a simple chat written in php socket'Oh
The site has authorization and user its ID.

How to create the conditions in sockets, so that the user receives only messages addressed to him?
April 3rd 20 at 17:16
1 answer
April 3rd 20 at 17:18
When on the server doing send() to specify the context id of the recipient, then on the front of the check
if (message.user_id === user_id)
When on the server doing send() to specify the context id of the recipient, then on the front of the check
if (message.user_id === user_id)

It works only in the General chat, judging by the question, the author there clearly is private chats between people, and send them events all in a row is not necessary in any case. - margarett commented on April 3rd 20 at 17:21
@margarett, Yes, you are right - Erling commented on April 3rd 20 at 17:24

Find more questions by tags PHPWebSocket