Cheatsheets

Personal collection of cheatsheets.

LiveKit

LiveKit is an open source project that provides scalable, multi-user conferencing over WebRTC.

Index

General

The documentation has guides and API references for deployment, working with rooms, etc.

Deployment can be made using the official Docker image. The server is configured using the livekit.yaml configuration file, a sample is available in the official repository.

Example of livekit.yaml:

port: 7880
rtc:
    port_range_start: 50000
    port_range_end: 50200
    tcp_port: 7881
    use_external_ip: true
keys:
    <API_KEY>: <API_SECRET>
logging:
    json: false
    level: info

Start in development mode.

livekit-server --dev

Create a room join token.

LIVEKIT_KEYS="<key>: <secret>" ./livekit-server create-join-token --room <room> --identity <user>

CLI

The livekit-cli command-line interface can be used to access server APIs, create tokens, create and join rooms, generate test traffic, etc.

Create a token.

livekit-cli create-token \
    --api-key <key> --api-secret <secret> \
    --join --room <room> --identity <user> \
    --valid-for 24h

Simulate a test publisher.

livekit-cli join-room \
    --url <url> \
    --api-key <key> --api-secret <secret> \
    --room <room> --identity <user> \
    --publish-demo

Publish media files.

livekit-cli join-room \
    --room <room> --identity <user> \
    --publish path/to/video.ivf \
    --publish path/to/audio.ogg \
    --fps 23.98

Simulate audio room.

livekit-cli load-test \
    --url <url> \
    --api-key <key> --api-secret <secret> \
    --room <room> --audio-publishers 10 --subscribers 1000

Simulate large meeting.

livekit-cli load-test \
    --url <url> \
    --api-key <key> --api-secret <secret> \
    --room <room> --video-publishers 150 --subscribers 150

Simulate livestreaming.

livekit-cli load-test \
    --url <url> \
    --api-key <key> --api-secret <secret> \
    --room <room> --video-publishers 1 --subscribers 3000

Profiling