Simple WebRTC-based video conferencing demo using PeerJS and Socket.IO.
A minimal demo that creates rooms (UUID-based) and connects peers for audio/video using PeerJS with Socket.IO for signaling/chat and an Express server that also hosts the Peer server.
- Create / join rooms by UUID
- Peer-to-peer audio & video via PeerJS
- Text chat powered by Socket.IO
- Mute / stop video controls
- EJS room template for simple UI
- Node.js (recommended 16+)
- npm
- Browser with WebRTC support (Chrome, Firefox, Edge)
- Camera / microphone permissions
- Install dependencies:
npm install
- Start the server:
By default the app listens on port 3030 (see package.json / server.js). Open the app:
npm start
Visiting the root generates and redirects to a room URL."$BROWSER" http://localhost:3030
- PeerJS on the client connects to the server's Peer endpoint (path
/peerjs). If you run HTTP on a non-standard port, ensure the Peer config inpublic/script.jsuses the correct host/port (it may default to port 443). - If camera/mic aren't visible, verify browser permissions and console logs.
- In a dev container, use the provided "$BROWSER" command to open the host's browser from the container environment.
- PORT: Express server port (default 3030 in server.js)
- Peer path:
/peerjs(configured in server and client) No other configuration is required for local testing.
- server.js — Express + Socket.IO + Peer server
- public/
- script.js — client WebRTC + UI logic
- style.css — styles
- views/
- room.ejs — room template (injects ROOM_ID)
- package.json — scripts & dependencies
- .github/workflows/ — CI workflow
- plan.md — project plan
- Blank video elements: check getUserMedia errors and permissions.
- Peer connection issues: confirm client peer config (host/port/path) matches server Peer server.
- If running behind HTTPS or a proxy, adjust PeerJS and Socket.IO client options accordingly.
Simple demo — open an issue or PR with improvements, bug fixes, or tests.
See package.json for license details (MIT-style in this repository).