And what is the proper infrastructure to scale WebRTC to thousands of listeners at once?
If you don’t actually need the low latency then you are better off with hls-ll delivered via a CDN.
https://www.digitalsamba.com/blog/p2p-sfu-and-mcu-webrtc-arc...
Personally I think simulcast (sending multiple differently encoded streams) is almost always wrong for many Webrtc uses (especially mobile publishers) but in the OBS case it actually makes a lot more sense.
If you want to know more you're probably best off going through the MDN docs about the WebRTC browser API and learning from that.
>And what is the proper infrastructure to scale WebRTC to thousands of listeners at once?
It looks like a pool of ingestion servers and a CDN for viewers. Ingestion servers handle getting the stream from the streamer and encoding it into whatever formats are needed. The CDN handles distributing this stream to people who want to watch it.