News for hackers. Stuff that matters.
Re:You might not need WebSockets by supahfly_remix on Friday April 11, 2025 @07:43PM (#43659914)
Do CDN, such as Cloudflare, support SSE? The last time I looked, they didn't, but maybe things have changed.
Re:You might not need WebSockets by hntrl on Friday April 11, 2025 @07:57PM (#43660019)
I have a demo of this for CF workers https://github.com/hntrl/eventkit/tree/main/examples/workers...

(it's not SSE in particular, but it demonstrates that you can have a long running stream like SSE)

Re:You might not need WebSockets by bastawhiz on Friday April 11, 2025 @07:51PM (#43659976)
Yes, they are
Re:You might not need WebSockets by nyrikki on Friday April 11, 2025 @08:25PM (#43660166)
Cloudflare doesn't officially support SSE, but if you send keepalives events every 15 or 20sec or so you can reliably use SSE for 40 min + in my experiance.

No server traffic for 100+ sec officially results in a 524, so you could possibly make that keepalive interval longer, but I haven't tested it.

Make sure to have the new style cache rule with Bypass cache selected and absolutely make sure you are using HTTP/2 all the way to the origin.

The 6 connections per browser limit of HTTP/1.1 SSE was painful, and I am pretty sure auto negotiation breaks, often in unexpected ways with a HTTP/1.1 origin.

Re:You might not need WebSockets by threatofrain on Friday April 11, 2025 @09:01PM (#43660343)
On top of the comments below about SSE, I'd also point out that Cloudflare is doing some interesting stuff around serverless resumable websockets. They also have stuff for WebRTC.