https://www.linux-projects.org/uv4l/tut ... d-sharing/
Here is an example of how to configure the Raspberry Pi to serve a web app which allows the Raspberry Pi to share its screen and speakers (“what you hear”) to the PC browser. Additionally, thanks to a virtual keyboard running on the Raspberry Pi, it will be possible to emulate the keypresses captured and sent from within the web page in the browser.
To summarize, this is the list of features:
- clientless, meaning that only a browser is necessary on the client side and that no browser plugins are required;
- no dependencies on third-party software components on the Raspberry Pi side: UV4L does all the magic (e.g. HTTP/HTTPS web server);
- use of secure and standard web technologies only, like WebRTC;
- can optionally “share the display” (everything on it, not just X screens): in facts, the frame buffer is captured and there is no need to install an X Server;
- can optionally share the what you hear audio: for example, if you a play music file on the Raspberry Pi, you will hear the sound coming out from the PC speakers;
- optionally headless Raspberry Pi: it does not matter if you have or not real display and speakers connected to it;
- keyboard emulation: what you type in the page is actuated on the Raspberry Pi;
- efficient, e.g. by using H264 hardware encoding and other optimized pipelines;
- no latency;
- can be password-protected;
- for developers: the web app is implemented with the React JS Library, so it can be easily debugged or further customized (e.g. with nodejs).