News for hackers. Stuff that matters.
Re:Server-sent events, WebSockets, and HTTP by parkerduckworth on Sunday February 20, 2022 @02:34PM (#30408541)
Yeah my personal experience is that if a SSE server has clients subscribed, and it goes down, the clients reconnect automatically once the server starts back up.

Only thing is the message ids reset when this happens.

Re:Server-sent events, WebSockets, and HTTP by Matthias247 on Sunday February 20, 2022 @07:48PM (#30410742)
I think this depends on the client/implementation. SSE call is just a http request with a continuous body stream. If it gets terminated clients could try to make another of those requests or not. That said the EventSource client in Browsers - which most people are likely using- will automatically reconnect
Re:Server-sent events, WebSockets, and HTTP by remram on Tuesday February 22, 2022 @09:42AM (#30428469)
The SSE spec contains the `retry` and `Last-Event-ID` mechanism. Of course if you are making your own implementation, nothing is provided, but I'm saying that the spec has such mechanisms built-in.

https://html.spec.whatwg.org/multipage/server-sent-events.ht...