https://www.marksort.com/udp-like-networking-in-the-browser/
I guess it's easier to piggyback on the security model of the P2P handshake than work out a separate model for client-server communication.
I built a pair of libraries for a nodejs<->browser DataChannel, it was a nightmare at the time though, and I'm sure totally obsolete by now.
Given how long it took for us to get %*@!$ data channels, I guess we'll get a simpler way to connect to a regular server in... 2030? (I watched WebRTC very closely from the Ericsson prototype was released... for awhile I was contemplating trying to pass data in the audio or video streams -_-)
The best thing is to design your gameplay to be "predictive", that's how we had ~300 player games like Subspace over 28.8/56k way back in the day.