Quick Start
This guide will help you get a Moq relay server running with a demo video stream in just a few minutes.The demo uses an insecure self-signed certificate intended for local development only. For production, you’ll need a proper domain and TLS certificate via LetsEncrypt or similar.
Prerequisites
Choose one of the following setup options:- Nix (Recommended)
- Manual Setup
Requirements:Nix provides a fully reproducible development environment with all dependencies included.
Running the Demo
- Nix
- Manual
Start the development environment
- Start a relay server on
localhost:4443 - Publish the Big Buck Bunny demo video
- Launch a web server with the demo UI
Open the demo
Visit https://localhost:8080 in your browser to see the demo.You’ll see the Big Buck Bunny video playing with real-time statistics.
What’s Happening?
Thejust dev command runs three services in parallel:
- moq-relay: A relay server that receives and forwards media streams
- Publisher: FFmpeg publishes the Big Buck Bunny video to the relay
- Web Server: Serves the demo UI that subscribes to and plays the stream
Understanding the Demo
The demo application demonstrates:- Real-time streaming: Sub-second latency from publisher to viewer
- Adaptive streaming: Multiple quality levels (if available)
- Statistics overlay: View bandwidth, latency, and frame metrics
- Chat: See how non-media data can be transmitted alongside video
Running Components Individually
For development or debugging, you can run each component separately:- Terminal 1: Relay
- Terminal 2: Publisher
- Terminal 3: Web Server
localhost:4443.Available Test Videos
The demo includes several test videos:bbb- Big Buck Bunny (default)tos- Tears of Steelav1- AV1 encoded test videohevc- HEVC encoded test video
Troubleshooting
Port already in use
Port already in use
If port 4443 is already in use, you can modify the port in
dev/relay.toml or kill the process using that port:Certificate errors in browser
Certificate errors in browser
The demo uses a self-signed certificate. Your browser will warn you about this. You can:
- Click “Advanced” and “Proceed” (Chrome/Edge)
- Click “Advanced” and “Accept the Risk” (Firefox)
- Or visit
http://localhost:4443/certificate.sha256to see the certificate fingerprint
Video not loading
Video not loading
Make sure all three services are running:
- Check that the relay is running:
curl http://localhost:4443/ - Verify the publisher is connected by checking relay logs
- Check browser console for WebTransport connection errors
IPv6 issues
IPv6 issues
If you have IPv6 connectivity issues, try changing the listen address in
dev/relay.toml from [::] to 127.0.0.1.Next Steps
Installation
Install Moq libraries for your project
Architecture
Learn how Moq is architecturally designed
Publishing
Publish your own media streams
Watching
Subscribe to and watch Moq streams