Rafael Viscarra, one of our engineers, wrote a blog post about using WebRTC to stream a remote server screen. Here’s how it works:
- The service starts and listens on port 9000 by default. We can change this with a flag.
- The service exposes two endpoints: (1)
POST /sessionstarts a session and (2)
GET /screensgets the available screens from the remote server.
- Once a screen is chosen, an SDP offer is created in the browser. For simplicity, there is a workaround in place to avoid trickle ICE.
- Once all ICE candidates have been gathered, a
POST /sessionrequest is made with the selected screen and browser’s SDP.
- The backend inspects the offer and checks to see if the browser supports h264 baseline 3.1. If everything goes well, the server responds with an SDP answer.
- The browser should receive and show the video stream.