Join Nostr
2024-09-16 16:44:12 UTC

Olivier Forget on Nostr: Server-Sent Events are under-appreciated. I get that people are scared of them ...

Server-Sent Events are under-appreciated. I get that people are scared of them because each ties up one of six connections (browser-wide) to the domain. But that's only under http 1.1. Under http/2 you get 100 usually. So no biggie?

The advantages are: amazingly simple API. You can have something useful, with automatic reconnects, in a few lines of JS. #WebSockets almost always involve loading a 3rd party library to take care of all the tricky bits.

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events