Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We...
by ambigious7777 on Monday March 18, 2024 @06:17PM
(#39750721)
I'm making a WASM browser dungeon crawler game using WebTransport. It currently does not have great support -- namely Safari -- but because of other API incompatibilities I'm not planning on supporting Safari :P
WebTransport is a bit more work than other ones, like SSE, but the flexibility and performance make it work it IMO.
You should in most cases just use websockets with a keep-alive ping every 30 seconds or so. It's not common anymore to block websockets on firewalls, so fallback solutions like Faye/Socket.io are typically not needed anymore.
WebTransport can have lower latency. If you're sending voice data (outside of regular webrtc), or have a realtime game its something to consider.