Can a Webrtc client use UDP messages from a server?

I was learning about webrtc and was wondering that if a Node.js server already knew the ip and port of a browser client, is there a way to send UDP messages to that client and read them via javascript with webrtc (or another method)? I know that browsers don’t allow sending UDP messages because of security concerns, but it would be interesting if a browser is able to read UDP messages.

Answer

No this isn’t possible today. There is a RFC for raw sockets but it isn’t implemented.

I would run a WebRTC implementation on your server and use the DataChannel. SCTP can be run in unreliable/unordered mode. It is really easy like this

There is also WebTransport but is just an RFC as well.