Skip to main content
Version: Beta 🚧

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:

VariableDescriptionDefault Value
PORTThe port on which the Edge node should listen for incoming connections8090
ORIGIN_PORTThe port on which the Worker's HLS files are available8085
ORIGIN_PROTOThe protocol of the origin serverHTTP
CERT_DIRDirectory containing fullchain.pem and privkey.pem for HTTPS connections on port 8443None
VOD_DIRDirectory statically served under the path /vod to access VoDs generated by the VoD Service/vod
MAIN_INSTANCEURL where your TUM-Live instance is available, used for public key exchangehttp://localhost:8081
ADMIN_TOKENToken used in place of the ?jwt query parameter to authenticate for streamsNone
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​

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

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.