Are people aware of https://www.w3.org/TR/tcp-udp-sockets/? I didn't see it mentioned so far.
It exposes many security concerns, that's why WebSockets were more favourable over TCPSocket. We want similar for UDP.
Due to that, WebSockets were created were handshake is handled by browser transparently from developer ensuring port scanning is not possible. As well as to preserver origin-based security model of HTTP. Which we want for WebUDP as well.