A simple peer-to-peer video calling app built with Node.js, Express, WebSocket, and Simple-Peer for direct browser-to-browser video communication. No database or frontend framework required — just pure WebRTC for learning or quick prototyping.
- One-on-one video chat via WebRTC
- Peer signaling using WebSocket (
ws) - Room-based connection using URL hash
- "End Call" button to stop the connection
- Minimal fullscreen UI with mirrored local video
- Lightweight setup with only Node.js
- Backend: Node.js, Express, WebSocket (
ws) - Frontend: HTML, CSS, JavaScript, Simple-Peer
- Deployment: Deployed on any Node.js hosting (e.g. Render)
- Node.js (v14 or later recommended)
- npm (comes with Node.js)
- Git (for cloning repository)
- Clone the repository
git clone https://github.com/HSA-ATTOCK/minimal-webrtc.git
cd minimal-webrtc- Install dependencies
npm install- Run the application locally
npm start- Open first browser and navigate to
http://localhost:5000/#roomname-2- Open second browser and navigate to
http://localhost:5000/#roomname-1Replace roomname with any unique name (e.g., chat, demo).
minimal-webrtc-video-chat/
├── public/ # Frontend file with inline script & styles
│ └── index.html
├── server.js # Node.js WebSocket signaling server
├── package.json # Project manifest
└── README.md # This documentation file
- One peer joins with
#roomname-2— becomes the receiver. - Second peer joins with
#roomname-1— becomes the initiator. - Peers exchange signaling data via WebSocket.
- After signaling, media is streamed peer-to-peer using WebRTC.
- The "End Call" button stops media and closes the connection/tab.
-
Push your project to GitHub.
-
Create a new Web Service on Render.com.
-
Connect your GitHub repository.
-
Set the following in Render’s deployment settings:
- Build Command:
npm install - Start Command:
node server.js
- Build Command:
-
Deploy and access your app at the provided Render URL.
- The server listens on the port specified by environment variable
PORT, or defaults to5000. - No session or database configuration is required.
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add your feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
Created by HSA-ATTOCK. Feel free to reach out for any questions or collaboration.