3 ms·
I use peerjs from Node to run a WebRTC channel between clients and server to do UDP streaming of browser viewports in the pro version of ViewFinder: basically a
by graderjs 5y ago
I use peerjs from Node to run a WebRTC channel between clients and server to do UDP streaming of browser viewports in the pro version of ViewFinder: basically a co-browsing enabled remote isolated browser. I think WebRTC is great!
It was also easy to set up. So far I have not had to run a STUN or TURN server myself, but I'm interested in exploring this in future. I think mainly this is because I use Websockets as an alternative channel so even if WebRTC won't go through (I've never encountered that, tho), I always have wss.
My initial reason for doing this was not just to provide an alternative to UDP, it was in my experience UDP is not always faster than Websocket for streaming the screencast frames, but it can be, and seems to especially be a good option when Websocket is slow for some reason. Because of this my strategy is to measure the roundtrip time (via frame acks) for each channel, and switch to the faster channel (UDP via WebRTC or TCP via Websocket) when the real-life bandwidth conditions tell me to.
Obviously, I'm not sitting there switching this over, the logic is built into the app itself, but it was just really cool how easy WebRTC was to set up and how much of a performance boost it gave. Overall, have the TCP/UDP dual-channel option smooths out a lot of real-world bandwidth irregularities, and is how I achieve optimal streaming right now.
A source available version of the above that does not include the advanced streaming I described is here: https://github.com/i5ik/ViewFinder https://github.com/i5ik/ViewFinder