3 ms·
Hello. I posted this before, but recently added WebRTC to stream the remote browser viewport. This noticeably improves the latency (I guess by removing TCP/WebS
by graderjs 6y ago
Hello. I posted this before, but recently added WebRTC to stream the remote browser viewport. This noticeably improves the latency (I guess by removing TCP/WebSocket overhead and utilizing UDP), and enables streaming in higher resolution.
It falls back to the old binary WebSocket method if the peers can't connect. It uses simple-peer (with wrtc on the server). The server is in Node.
I intend to experiment with further improvements in future such as:
- sending frames as they are produced, rather than when the client requests them (as it currently does, at a small interval, or when you interact with the page).
- seeing if it's possible to stream multiple frames to cwebp for encoding rather than running a new process per frame.
- experimenting with creating an actual media stream (as opposed to a stream of frames) using ffmpeg.
People have requested higher quality video and these are some of my works in this direction. I'm really happy to have integrated WebRTC, it's been on my todo list for a while and the integration was relatively painless.
Note that it only uses the simple-peer default STUN servers, and does not provide any TURN servers in case the connection cannot be established. If anyone has any comments of suggestions to achieve higher performance, or can suggest a good NodeJS (or other, easy to set up) open-source TURN server I can run, that will be cool.
edit: some limitations:
- I disabled WebGL because on some sites (like the new GitHub homepage) headless + WebGL is very slow. This means some sites that use 3D apis for editing or display of graphic content may not work.
- You can't download files
- DevTools doesn't work on Safari browsers yet
some things you can do:
- upload files
- handle basic auth and other modals
- head sound (like YouTube, etc. But strangely some sounds, like the MP3 on Cachemonet.com don't work)