Introduction
Pion WebRTC is a pure Go implementation of the WebRTC API. This reference documentation covers the core types and methods for building real-time peer-to-peer communication applications.Core Components
The Pion WebRTC API is organized around several key components:API Configuration
The foundation of customizing WebRTC behavior:API
Configure PeerConnection with custom SettingEngine, MediaEngine, and Interceptors
Peer Connection
The central interface for WebRTC connections:PeerConnection
Establish peer-to-peer communications with media and data channels
Configuration
Define connection parameters:Configuration
Configure ICE servers, transport policies, and certificates
Session Description
Manage SDP offers and answers:SessionDescription
Handle SDP negotiation for establishing connections
Architecture
Pion WebRTC follows the standard WebRTC architecture:Quick Start
Key Concepts
Signaling
Pion WebRTC handles media transport but requires external signaling to exchange:- Session descriptions (SDP offers/answers)
- ICE candidates
- Connection state
Media Handling
The API provides:- RTPTransceiver: Bidirectional media streams
- RTPSender: Outbound media
- RTPReceiver: Inbound media
- TrackLocal/TrackRemote: Audio/video tracks
Data Channels
For non-media communication:- Reliable or unreliable delivery
- Ordered or unordered messages
- Custom protocols
Common Patterns
Creating an Offer
Creating an Offer
Handling an Answer
Handling an Answer
Adding Media Tracks
Adding Media Tracks
Creating Data Channels
Creating Data Channels
Next Steps
API Configuration
Learn how to configure the API with custom engines and interceptors
PeerConnection
Explore PeerConnection methods and event handlers
Configuration
Configure ICE servers, policies, and certificates
SessionDescription
Understand SDP types and session negotiation
Source Reference
All API documentation is extracted from the actual Pion WebRTC source code:- Package:
github.com/pion/webrtc/v4 - License: MIT
- Copyright: 2026 The Pion community