Edge Server
The Edge module is designed as a simple Edge proxy and cache node for TUM-Live/worker. When network traffic to worker nodes exceeds the available bandwidth, the architecture might look like this:
βββββββββ proxy /stream1.m3u8
βββββββββββββββββββ βββΊ βEdge 1 ββββββββββββββββββββββββββββ βββββββββββββ
β βββββββββββββββββββββββββββ βββββββββ βββΊβ β
β Load Balancer βGET /worker-n/stream1.m3u8 β worker-n β
β(DNS-RR/HTTP 302)βGET /worker-n/media123.ts β β
β βββββββββββββββββββββββββββ βββββββ ββ βββΊβββββββββββββ
βββββββββββββββββββ βββΊ βEdge 2 ββββββββββββββββββββββββββββ
βββββββββ proxy & cache /media123.ts
Configurationβ
The following configuration options are available via environment variables:
Variable | Description | Default Value |
---|---|---|
PORT | The port on which the Edge node should listen for incoming connections | 8090 |
ORIGIN_PORT | The port on which the Worker's HLS files are available | 8085 |
ORIGIN_PROTO | The protocol of the origin server | HTTP |
CERT_DIR | Directory containing fullchain.pem and privkey.pem for HTTPS connections on port 8443 | None |
VOD_DIR | Directory statically served under the path /vod to access VoDs generated by the VoD Service | /vod |
MAIN_INSTANCE | URL where your TUM-Live instance is available, used for public key exchange | http://localhost:8081 |
ADMIN_TOKEN | Token used in place of the ?jwt query parameter to authenticate for streams | None |
warning
Keep your admin token secret, as it can be used to access any recordings on your Edge Server. You can change the token any time by re-deploying your Edge Server.
Setup Edge Serverβ
- Docker
- Manually
Start the Edge Server:
docker run -d \
-p 80:8090 \
-p 443:8443 \
-e CERT_DIR=/cert/ \
-e VOD_DIR=/vod/ \
-e MAIN_INSTANCE=https://live.rbg.tum.de \
-e ADMIN_TOKEN=<insert-your-admin-token> \
-e PORT=8090 \
-v /path/to/vod:/vod \
-v /path/to/cert:/cert \
ghcr.io/tum-dev/gocast/worker-edge:latest
-
Clone the GoCast repository:
git clone https://github.com/tum-Dev/gocast
-
Change into the Edge directory:
cd gocast && cd worker/edge
-
Start the Edge Server:
TODO
Test Edge Serverβ
To test that the Edge is working as expected, upload a sample video (e.g., Exiting_video.mp4
) to your storage and try to access it:
curl <your-edge-server-addr>/vod/Exiting_video.mp4/playlist.m3u8?jwt=<jwt>
This should only return the video / playlist file if the JWT is valid.