Peer-to-peer voice/video calls in the browser. Pure static site (WebRTC media + free PeerJS cloud for signaling) — hosted on Cloudflare Pages, no server to run.
Live: https://simple-webrtc-call.parithosh.workers.dev (geo-restricted, see below)
worker.js only serves the site within RADIUS_KM (default 5 km) of CENTER_LAT / CENTER_LON, using Cloudflare's per-request geolocation. Tweak the values in wrangler.jsonc and run npx wrangler deploy.
public/index.html/app.js/style.css— the whole app.- Signaling (exchanging SDP offers/answers + ICE) goes through the free PeerJS cloud. Voice/video itself is peer-to-peer via WebRTC (STUN).
- No build step, no backend.
- Open the Pages URL on both devices, allow camera + mic.
- Each side gets a Your ID. Share it via Copy Invite Link.
- Enter the other person's ID → Call. Incoming calls auto-answer.
Any static server works, e.g.:
npx serve public
# or
python3 -m http.server -d public 3000npx wrangler pages deploy public --project-name simple-webrtc-call(No build command, output directory: public.)
vps/ holds a zero-dependency Node server (same 5 km geo-gate, IP lookup via ip-api with caching) plus Caddy for auto-HTTPS and a multi-host deploy script. Assumes Debian/Ubuntu + sudo + SSH, DNS already pointed.
DOMAIN=call.example.com ./vps/deploy.sh user@vps1 [user@vps2 ...]Tune the gate via CENTER_LAT / CENTER_LON / RADIUS_KM / ALLOWED_IPS in vps/signal.service, then re-run the script. Point one DNS name at all four VPS IPs (round-robin) or pick a primary.