Let's assume there are a several clients that must receive updated data from server. They connect to server and communicate using Server Sent Event push.
How SSE knows that concrete message should be addressed to concrete client like it works in sockets?
Does it support broadcast or private messages?
How SSE knows that concrete message should be addressed to concrete client like it works in sockets?
The client connects to an URL on the server. You can optionally add query parameters to the URL that can be used for logic.
Since the client have initiated the connection, the server must all the time hold a "handle" to this connection, so it can use it to send data. In this way, it is similar to sockets.
Does it support broadcast or private messages?
The server must iterate over all connection handles to send data to all clients. It can send data to only some clients, similar to private messages. How the connections is handled is up to the server.