Build Your Own Remote Desktop Application using Javascript, Python & WebRTC — Part 1
Reason for using Nodejs :
To develop a remote desktop application we need Electron. With the help of “Electron”, we can build our application using Javascript. Here javascript plays an important role in accessing the “WebRTC API”.
Reason for using Python :
Python is used to execute the mouse and keyboard events that are received from the client. Here we will use the PyAutoGui library for events execution.
How the communication will be established between Electron & Python ?
To establish communication between Electron & Python we will use “WebSockets” library. Using this library we will create a local server that will transfer data between Electron (Javascript) & Python.
Libraries used in this project
Nodejs Libraries :
- Electron
- Express.js
- Socket.io
- websocket
- Peerjs
Python Libraries :
How this remote desktop application will works ?
The remote desktop application which we going to build is fully based on “WebRTC”. It is a real-time communication technology that can be used to establish a peer to peer communication between two clients. By using “WebRTC” we can stream our audio and video directly from the browser and also we can able to share the computer screen using “Screen Share API”.
Note : In this blog, we mainly focus on building the application. If you want to know more details about WebRTC please checkout https://webrtc.org/
To make this project possible we need to build three major things they are Signaling Server, Screen Sharing Application, and Client Web Application.
Signaling Server
Step 1 : Building the signaling server is the first step of our project. This server is only required to establish a WebRTC connection between two clients. In our case, it will be Screen Sharing Application & Client Web Application.
Screen Sharing Application
Step 2 : Using Electron & Python we will build a screen sharing application that will transmit live screen to the client and also receive the keyboard and mouse events from a client and execute it on the same (host or remote) system.
Client Web Application
Step 3 : This is the final step of our project and in this phase, we will build a client web application that will receive the live screen from the remote pc, and also we can able to control the remote pc from this web application.
In part 2 we will see how to build “Screen Share with Mouse Onclick Events” on the same system using websockets.