Hacker News new | ask | show | jobs
by desdenova 581 days ago
WebSockets are TCP-only.

WebRTC can run over UDP, but it's not raw UDP. I think that's what they meant.

3 comments

Yes, it's WebRTC. It uses real unreliable and unordered UDP packets, peer-to-peer. But WebRTC requires a connection establishment step to happen first, so it can't send traffic to arbitrary UDP services, only cooperating WebRTC peers. Which is fine for multiplayer games.
I don't have time to look into the code right now, but it might also be WebTransport:

https://developer.mozilla.org/en-US/docs/Web/API/WebTranspor...

EDIT: actually I can't find the code, shouldn't it be linked as per GPL's license?

WebSockets also initiate a normal Http request first, further complicating things anyway.