Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LessUp/webrtc

Repository files navigation

LessUp WebRTC

A polished WebRTC learning demo with a Go signaling server and a vanilla JavaScript client.

CI Pages License: MIT Go Version

English | 简体中文 | Docs Site | OpenSpec Hub

Why this project

LessUp WebRTC is designed for people who want a small, readable codebase that still covers the core moving parts of real-time browser communication:

  • WebSocket signaling with identity binding and room management
  • peer-to-peer media and DataChannel chat
  • screen sharing
  • a framework-free frontend served directly by Go
  • Docker-ready deployment and a public docs site

What is implemented

Area Status
Signaling server Go + Gorilla WebSocket
Browser client Vanilla JavaScript ES modules
Call model 1:1 and small-room mesh
Media controls Mute, camera toggle, screen share
Docs and specs GitHub Pages + OpenSpec

Quick start

Run locally

git clone https://github.com/LessUp/webrtc.git
cd webrtc
go run ./cmd/server

Open http://localhost:8080, join the same room in two browser windows, and start a call.

Run checks

make check
cd web && npm test

Docker

docker build -f deploy/docker/Dockerfile -t webrtc .
docker run --rm -p 8080:8080 webrtc

Architecture at a glance

Browser UI
 └─ web/src/core/app.js
 ├─ controllers/media.js
 ├─ controllers/peers.js
 ├─ controllers/signaling.js
 └─ controllers/ui.js
Go server
 ├─ cmd/server/main.go
 └─ internal/signal/

The server exposes:

  • GET / — static frontend
  • GET /config.js — runtime RTC config
  • GET /healthz — health probe
  • GET /ws — signaling socket

Specs and workflow

This repository uses OpenSpec as its only planning and requirements system.

Typical flow:

  1. propose or update an OpenSpec change
  2. implement against proposal.md, design.md, and tasks.md
  3. validate with repo checks
  4. review before merge

Project structure

cmd/server/ application entrypoint
internal/signal/ signaling hub and tests
web/ static frontend
docs/ public documentation
openspec/ specs and change artifacts
deploy/ Docker, Caddy, and deployment assets

Documentation

Contributing

Start with CONTRIBUTING.md and the active OpenSpec change. This repo prefers focused, low-noise contributions that keep the implementation, docs, and repo metadata aligned.

About

Lightweight WebRTC Demo: Go Signaling Server + Vanilla JavaScript Client, OpenSpec-Driven Development | 轻量级 WebRTC 演示:Go 信令服务 + 原生 JavaScript 客户端,OpenSpec 驱动开发

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /