It's probably worth me mentioning that there is a bit of an issue with relying on Server Sent Events for anything apart from casual and non-critical notifications and that is that transparent proxies in the middle will totally break them. NGINX talking to another NGINX would appear to completely break the connection (because even if you set headers to say don't buffer content, the first one doesn't forward them). Unfortunately, the specification of the necessary headers means that any old bit of infrastructure can choose to just buffer until the stream is closed - happens more on older kit that isn't configured well, but it's out there and can quite legally stop the streaming. I wrote this about it and my rather disastrous experience.
Web sockets wouldn't have that problem?
WebSockets would have that problem (and probably more as my linked article mentions) - so libraries like socket.io use long polling and try to upgrade to sockets.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.