Hacker News new | ask | show | jobs
by looshch 577 days ago
> to the web

you mean like to browser? If yes, how did you achieve UDP connections? To my best knowledge, browsers allow TCP only

1 comments

WebSockets are TCP-only.

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

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.