Skip to content
FossShelf
Home / Categories / For Communication Teams

Webrtc

Go WebRTC stack for real-time media and data

Replaces —

16.90K starsMITlast commit 15 Nov 2026

Who it's for

Media server and SFU developers

Go developers building selective forwarding units, transcoding servers, or broadcast ingest endpoints use pion/webrtc's Media API to handle WebRTC peer connections, codec negotiation, and RTP/RTCP forwarding. LiveKit and MixinNetwork/kraken are examples of this pattern.

You need a managed SFU with billing and SDKs rather than a protocol library.

Peer-to-peer tooling authors

Projects that need encrypted, NAT-traversing peer-to-peer channels use pion/webrtc's DataChannel API or pion/ice and pion/dtls independently. coder/wush, netbird, snowflake.torproject.org, and libp2p's Go WebRTC transport follow this approach.

Your transport requirements are met by a simpler TCP or UDP library without NAT traversal needs.

Embedded and IoT device firmware

Devices like JetKVM and NanoKVM use Pion to stream H.264 video over WebRTC directly from Go-based firmware without a native libwebrtc build. The pure-Go compilation makes this practical on ARM targets.

Your device runs a non-Go firmware stack.

Infrastructure and monitoring agents

Monitoring agents that need DTLS-secured transport (Telegraf, Categraf) or NAT discovery (go-ethereum, frp, Mysterium Node) import only the pion/dtls or pion/stun sub-packages they need, keeping binary size small.

Your agent does not require encrypted UDP transport or NAT traversal.

The problem

Building real-time audio, video, or peer-to-peer data applications in Go historically required wrapping libwebrtc, a large C++ library that complicates cross-compilation, static linking, and deployment on embedded or server targets. Pion solves this by reimplementing the complete WebRTC protocol stack in pure Go, giving backend developers a dependency-free, cross-platform foundation for streaming, conferencing, file transfer, and low-latency data applications without native build toolchains.

How it works

Pure-Go WebRTC implementation

The entire stack — ICE, DTLS, SCTP, RTP, RTCP, STUN, TURN — is written in Go with no CGo or libwebrtc dependency, enabling standard Go cross-compilation and static binaries for Linux, macOS, Windows, and embedded targets.

WHIP and WHEP support

Pion supports the WebRTC HTTP Ingest Protocol (WHIP) and HTTP Egress Protocol (WHEP), allowing direct ingest from OBS and broadcast-box at sub-second latency to browser viewers without a media relay.

DTLS 1.3

The pion/dtls library implements DTLS 1.3, documented in a 2026 blog post covering the implementation details and interoperability considerations for Go-based media servers.

RACK-accelerated SCTP

A 2025 engineering update added RACK-based loss recovery to pion/sctp, achieving 71% higher throughput and 27% lower latency compared to the previous implementation, directly benefiting DataChannel-heavy applications.

Standalone protocol libraries

ICE, STUN, TURN, DTLS, SCTP, RTP, and RTCP are published as independent Go modules. Projects like frp, go-ethereum, Telegraf, and Hysteria use only the specific Pion sub-packages they need without pulling in the full WebRTC peer connection layer.

RFC 8260 DataChannel multiplexing

A 2026 fix addressed WebRTC DataChannel head-of-line blocking using RFC 8260 stream scheduling, improving latency for applications that open multiple concurrent data channels.

Features

  • Pure-Go WebRTC implementation
  • WHIP and WHEP support
  • DTLS 1.3
  • RACK-accelerated SCTP
  • Standalone protocol libraries
  • RFC 8260 DataChannel multiplexing

How to install

go get github.com/pion/webrtc/v4

Recommended for this setup

Strengths

  • Proven at scale: Pion is embedded in widely deployed systems: Raspberry Pi Connect for remote device access, Tor's Snowflake for censorship circumvention, LiveKit's WebRTC SFU, and go-ethereum for NAT discovery. The awesome-pion list documents dozens of production projects across media, networking, and AI tooling.
  • No native build dependencies: Because Pion is pure Go, it cross-compiles with the standard Go toolchain. Developers targeting ARM devices, static Docker images, or unusual OS targets avoid the libwebrtc build complexity that affects wrappers in other languages.
  • Composable sub-packages: Applications that only need STUN-based NAT traversal or DTLS encryption import only those packages. This composability is evident from the Pion user list: Telegraf and Categraf use pion/dtls for certificate inspection without any media API dependency.
  • Active protocol engineering: The project regularly ships protocol-level improvements backed by blog posts and conference talks. Documented examples include RACK SCTP (2025), DTLS 1.3 (2026), RFC 8260 DataChannel fix (2026), and WHIP bitrate optimization (2026).

Trade-offs

  • Go only: Pion's libraries are Go packages. Projects written in Rust, C++, Python, or JavaScript cannot use Pion directly and would need a language-native WebRTC implementation or a separate Go service boundary.
  • No built-in signaling server: WebRTC requires a signaling layer to exchange SDP offers and ICE candidates. Pion implements the peer connection and media transport but leaves signaling design to the application, which adds integration work compared to fully bundled SFU platforms.
  • Low-level API surface: Pion exposes protocol primitives rather than a high-level conferencing API. Teams wanting an out-of-the-box video conferencing product should evaluate platforms built on top of Pion (such as LiveKit or plugNmeet) rather than building directly on pion/webrtc.

Tech stack

Languages
Go, HTML, Shell, JavaScript, Dockerfile
Frameworks
—
Databases
—
Tooling
WebAssembly

FAQ

Is Pion a standalone application or a library?

Pion is a collection of Go libraries, not a standalone application. You import packages such as pion/webrtc, pion/ice, pion/dtls, or pion/stun into your own Go program. The awesome-pion list links to applications built on top of these libraries.

Does Pion require libwebrtc or CGo?

No. Pion is implemented entirely in Go with no CGo bindings and no dependency on Google's libwebrtc C++ library. It compiles with the standard Go toolchain and supports cross-compilation to any platform Go targets.

Which codecs does Pion support?

Pion handles codec negotiation and RTP packetization for common WebRTC codecs including VP8, VP9, H.264, Opus, and G.711 (ulaw/alaw). Actual encoding and decoding is left to the application or to separate codec libraries.

Can I use only part of the stack, such as just STUN or DTLS?

Yes. Each protocol is a separate Go module. frp uses pion/stun for NAT traversal, bjdgyc/anylink uses pion/dtls for VPN encryption, and Telegraf uses pion/dtls for certificate inspection, none of them pulling in the full peer connection API.

Where can I find examples and community support?

Official examples live in the pion/webrtc repository under the examples directory, and more complete applications are in pion/example-webrtc-applications. The project maintains a Discord server and a mailing list linked from pion.ly, and the companion book WebRTC for the Curious covers the underlying protocols.

Similar tools

More in Communication Teams