webrtc-pion
Context: $ARGUMENTS
Pion is the canonical Go WebRTC stack. It is a library, not a server — you embed it in your own binary. The helper script in this skill wraps the examples repo for fast prototyping: it fetches one example via git sparse-checkout, builds it, and runs it.
Quick start
- Browse canonical examples: → Step 2 (
pion.py list-examples) - Fetch + build + run one example: → Step 3
- Quick WHIP/WHEP round-trip: → Step 5
- Stand up a TURN server: → Step 6
When to use
- User wants a WebRTC server in Go (SFU, WHIP ingest, RTP bridge).
- Need to save WebRTC media to disk, or play a file into a PeerConnection.
- Need to insert low-level hooks (insertable streams, custom RTCP feedback, encoded transforms) that the browser API doesn't expose.
- Pair with
webrtc-specwhen you need to verify protocol details as you build.
Use webrtc-mediasoup or webrtc-livekit instead if the user wants a full product out of the box — Pion is one layer down from both.
Step 1 — Prerequisites
- Go >= 1.22 (
go version). Install viabrew install go/apt install golang-go/ golang.org. giton PATH.
uv run ${CLAUDE_SKILL_DIR}/scripts/pion.py check
Prints Go version + git presence + current GOPATH.
Step 2 — Browse canonical examples
uv run ${CLAUDE_SKILL_DIR}/scripts/pion.py list-examples
Canonical set (mirrors https://github.com/pion/webrtc/tree/master/examples):
| Example | What it demonstrates |
|-------------------------|---------------------------------------------------------|
| broadcast | Minimal 1-to-N SFU |
| sfu-ws | WebSocket-signaled SFU |
| simulcast | Simulcast ingest + forwarding |
| play-from-disk | Send a local IVF/Ogg file as a WebRTC track |
| save-to-disk | Persist incoming RTP to IVF/Ogg |
| save-to-webm | Mux received tracks to a WebM file |
| data-channels | Basic SCTP data channel round-trip |
| data-channels-detach | Detach a data channel for raw io.ReadWriter usage |
| data-channels-close | Clean DC shutdown handshake |
| ice-tcp | ICE over TCP fallback |
| ice-single-port | Multiplex all UDP flows on one port (SFU-style) |
| ice-restart | Trigger ICE restart mid-session |
| insertable-streams | Encoded-transform hooks (E2EE, watermarks) |
| rtp-forwarder | Receive over WebRTC, forward RTP to a UDP socket |
| rtp-to-webrtc | Ingest raw RTP, expose as a WebRTC track |
| whip-whep | WHIP ingestion + WHEP egress |
| stats | StatsReport snapshot dump |
| custom-logger | Pluggable logging |
| swap-tracks | Hot-swap a TrackLocal at runtime |
| trickle-ice | Explicit trickle-ICE signaling |