Server-sent events don't go to all clients

Hopefully I’ve picked the right category for this kind of question…

I found this example how to send Server-sent events (SSE) from Golang (using Gin) and consume them in an Angular app.

The Server sends an SSE every second. The events contain a timestamp for better analysis of the result.

It works the way I expect when there is ONE client - an event is received every one second.

How ever I noticed that when there are THREE clients (I used different browsers on the same machine to mimic some realism) the events would not go to all clients. Every client will receive one event in three seconds (or one event in two seconds if there are two clients listeing)

(notice the gaps of 3 seconds in the timestamps in each client’s window)

Is this normal behavior of the SSE-technique or specific to the implementation of that example?

Would you suggest to use SSE to build a “user-activity live stream” which displays what other people are looking at right now? It basically worked as I extended the example, except for this “weird” effect that not all events were seen on all clients.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.