This wiki documents the LiveKit server codebase, a production-grade WebRTC Selective Forwarding Unit (SFU) written in Go. The server enables scalable, real-time video, audio, and data communication for multi-user applications.
Scope: This page provides a high-level introduction to the server's architecture, core components, and operational modes. For detailed subsystem documentation, see System Architecture Overview and Key Technologies and Dependencies.
LiveKit server is a WebRTC SFU that routes media streams between participants without transcoding. Written in Go go.mod1-3 and built on the Pion WebRTC stack go.mod42 it implements a selective forwarding architecture where each participant's media is received once and selectively forwarded to subscribers based on bandwidth and subscription preferences.
Core Capabilities:
1.11.0 CHANGELOG.md7-21Entry Point: The main server logic is coordinated through the LivekitServer structure, which manages services, listeners, and the signaling stack.
Sources: README.md11-43 go.mod1-42 CHANGELOG.md5-21 version/version.go17
LiveKit server is organized into functional layers that bridge high-level API requests to low-level media forwarding.
This diagram maps natural language concepts to the specific Go entities and files that implement them.
Layer Responsibilities:
Router interface.RoomManager orchestrates the lifecycle of Room instances on a local node.UpDataTrackManager CHANGELOG.md13Sources: README.md26-43 CHANGELOG.md12-14 go.mod25-50
The top-level server structure initialized using Wire dependency injection go.mod16 It manages the HTTP servers for APIs and the SignalServer for WebRTC signaling.
The central orchestrator on a node. It maintains the active room sessions and provides helpers for session lookup and participant routing.
Represents an active multi-user session. It manages a collection of participants and coordinates track metadata and state synchronization.
For details on how these components interact, see System Architecture Overview.
Sources: go.mod16 README.md11-16
LiveKit uses a hierarchical configuration system:
urfave/cli/v3 go.mod149The configuration covers networking, Redis for distribution, SFU parameters, and TURN server settings. Recent additions include options for forcing simulcast codecs and requiring media sections during join CHANGELOG.md59-125
Sources: go.mod149 go.mod59 CHANGELOG.md59-125
LiveKit's behavior changes based on the presence of Redis in the configuration.
The server is wired differently depending on whether Redis is utilized for state and routing.
Router abstraction.Sources: go.mod45 README.md42
The server relies on several critical libraries:
For a full list and technical details, see Key Technologies and Dependencies.
Sources: go.mod5-61 magefile.go1-77 version/version.go17
This page is a high-level entry point. Detailed technical specifications are available in the sub-pages.
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.