How do I test egress? Do I have to deploy the agen...
# ask-ai
i
How do I test egress? Do I have to deploy the agent to Livekit cloud to see if it works? Or if there's a way to test locally?
t
Thanks for reaching out, Kuangji. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to guide you through testing egress in LiveKit, whether you're working locally or on a deployed instance, based on your setup: Local Testing: • You can run the LiveKit egress service using Docker against a local LiveKit server. Just configure the service with a YAML file that includes your API key, API secret, websocket URL, and Redis connection details. • Make sure Redis is accessible from the Docker container by adjusting its configuration—for example, commenting out
bind 127.0.0.1
and setting
protected-mode no
. • Find your host IP as Docker sees it (like
172.17.0.1
on Linux) and use that in your
ws_url
and Redis address settings. • If you're storing files locally, remember to mount a volume with your
docker run
command (something like
-v ~/livekit-egress:/out/
) and ensure everyone has write permissions. Testing Custom Templates: • The LiveKit CLI has a handy command:
lk egress test-template
. It helps you create a room, add virtual publishers, and check your templates while you're developing. Deployed Environment Testing: • For integration tests on your LiveKit rooms, create a
config.yaml
with your server’s secure websocket URL, then run
mage integration test/config.yaml
. If you have any questions or need more help with any of these steps, please don’t hesitate to reach out—I’m here to support you! Sources: test/segments.go | Custom recording templates | LiveKit Docs | README.md | Self-hosting the Egress Service | LiveKit Docs