Skip to content

About

Peer-to-peer voice and video calls in the browser. Pure static site using WebRTC media and PeerJS signaling, geo-fenced by a Cloudflare Worker. No server to run.

Topics

Resources

Stars

22 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple WebRTC Call App

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)

Access control

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.

How it works

  • 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.

Use it

  1. Open the Pages URL on both devices, allow camera + mic.
  2. Each side gets a Your ID. Share it via Copy Invite Link.
  3. Enter the other person's ID → Call. Incoming calls auto-answer.

Run locally

Any static server works, e.g.:

npx serve public
# or
python3 -m http.server -d public 3000

Deploy to Cloudflare Pages

npx wrangler pages deploy public --project-name simple-webrtc-call

(No build command, output directory: public.)

Run on your own VPS(s)

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.

About

Peer-to-peer voice and video calls in the browser. Pure static site using WebRTC media and PeerJS signaling, geo-fenced by a Cloudflare Worker. No server to run.

Topics

Resources

Stars

22 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages