A lightweight, high-performance screen sharing application using WebRTC and Node.js.
screen-sharing-app/
├── public/
│ ├── sender.html # Android Sender UI
│ ├── sender.js # Android Sender Logic (WebRTC)
│ ├── receiver.html # PC Receiver UI
│ └── receiver.js # PC Receiver Logic (WebRTC)
├── server/
│ └── server.js # Node.js Signaling Server
├── package.json # Dependencies
└── README.md # Setup Instructions
- Install Node.js: Download and install from nodejs.org.
- Open Terminal: Navigate to the
screen-sharing-appfolder. - Start Server:
npm install npm start
- Access the App:
- Sender (Phone): Open
http://YOUR_PC_IP:3000/sender.html - Receiver (PC): Open
http://localhost:3000/receiver.html
- Sender (Phone): Open
Note: Replace YOUR_PC_IP with your local IP address (find it by running ipconfig in CMD).
To access this globally, you must use HTTPS as modern browsers (especially on Android) block getDisplayMedia on non-secure connections.
- Deploy to VPS: Upload the folder to your server.
- Setup SSL: Use Nginx with Certbot (Let's Encrypt) to serve the app over HTTPS.
- TURN Server: For restrictive networks (mobile data), add a TURN server configuration in
sender.jsandreceiver.js.- Recommended: Twilio Network Traversal Service or OpenRelay.
- Works best in Chrome for Android.
- When you click "Start Share", a system popup will ask for permission to record/cast. Select "Entire Screen".
- Security: The browser requires HTTPS to enable screen capture APIs.
- No connection? Ensure both devices are on the same WiFi for local testing.
- ICE Failed? This usually happens on mobile data. You will need to add a TURN server to the
iceServersarray in the JS files. - Permission Denied? Make sure you are using
https://if not onlocalhost.
