| layout | docs |
|---|---|
| title | Technical Guide — WebRTC |
| description | Architecture and code map for the LessUp WebRTC project. |
This page describes the current code layout, runtime flow, and the boundaries between the Go signaling server and the browser client.
cmd/server/main.go HTTP entrypoint and static file serving
internal/signal/hub.go signaling hub, rooms, limits, cleanup
internal/signal/message.go message envelope
web/src/core/app.js browser app assembly
web/src/controllers/ media, peers, signaling, stats, UI
web/src/config.js client defaults and capability checks
- the browser loads static assets from
/ web/src/core/app.jsassembles the controllers- the client opens
ws://host/wsorwss://host/ws - the Go hub relays
join,offer,answer,candidate, and membership updates - media and chat move peer-to-peer after negotiation
cmd/server/main.go serves four main concerns:
- static frontend files
GET /config.jsfor runtime RTC config injectionGET /healthzfor health checksGET /wsfor signaling
The hub in internal/signal/ owns:
- room creation and cleanup
- client identity binding
- origin checks
- message validation and routing
- send timeouts and rate limits
The frontend is intentionally split by responsibility:
| Module | Responsibility |
|---|---|
core/app.js |
wires everything together |
controllers/media.js |
local media, screen share, recording |
controllers/peers.js |
RTCPeerConnection lifecycle and chat |
controllers/signaling.js |
WebSocket join/leave/reconnect flow |
controllers/stats.js |
connection stats |
controllers/ui.js |
DOM updates and control state |
config.js |
client ID, capability checks, RTC defaults |
go run ./cmd/server
make check
cd web && npm test
cd e2e && npm test