Pion WebRTC implements the WebRTC API in Go without cgo, enabling peer connections, media, data channels, and ICE across servers, desktops, mobile, and WebAssembly targets.
Overview
Pion WebRTC is a Go implementation of the WebRTC API aimed at real-time audio, video, and data communication. It is positioned as part of the broader Pion stack for cross-platform media and data planes, with emphasis on portability and builds that avoid cgo.
Developers get a PeerConnection API with send and receive paths for audio and video, renegotiation, Plan-B and Unified Plan modes, data channels with ordered or unordered delivery, and direct RTP and RTCP access. Connectivity features include a full ICE agent, trickle ICE, ICE restart, STUN, TURN over UDP TCP DTLS and TLS, and mDNS candidates.
Media helpers cover Opus, PCM, H264, VP8, and VP9 packetizers, container utilities such as IVF, Ogg, H264, and Matroska for capture and replay, simulcast, and bandwidth estimation. Security pieces list DTLS 1.2 cipher suites and SRTP AEAD options, with hardware acceleration noted for some GCM suites.
The library targets Windows, macOS, Linux, FreeBSD, iOS, Android, and WebAssembly examples, with published sample apps for disk playback, embedded webcam streaming, server-to-server data channels, conferencing, and robotics-style remote video. Documentation references example repositories, an awesome list of adopters, GoDoc APIs, and a vendor-neutral WebRTC explainer book.
Key features
- PeerConnection API in pure Go
- Audio video and DataChannel support
- ICE STUN TURN and trickle ICE
- RTP RTCP media packetizers
- Simulcast and bandwidth estimation
- DTLS and SRTP security suites
- No cgo wide CPU architectures
- WebAssembly example targets
Use cases
- Embedding WebRTC in Go services
- Server-to-server secure data channels
- Embedded webcam streaming
- Conferencing with processed media
- WASM browser-side experiments