MediaFlow Integration¶
MediaFlow Proxy is a caching and optimization proxy for IPTV streaming. tunlx integrates with it out of the box: turn it on per proxy and tunlx routes the right paths through MediaFlow without changing your client setup.
Why bother¶
- Adaptive buffering for HLS streams that stutter on slow upstreams.
- Range request handling so VOD seeking actually works.
- Origin offload — MediaFlow does the heavy lifting, your tunlx host doesn't.
- Header preservation for upstreams that gate on auth headers.
Path routing¶
When mediaFlowEnabled is true, tunlx routes these client paths through
MediaFlow:
| Client path | MediaFlow target |
|---|---|
/live/... |
/proxy/hls or /proxy/stream (by extension) |
/movie/... |
/proxy/hls or /proxy/stream |
/series/... |
/proxy/hls or /proxy/stream |
/hls/... |
/proxy/hls |
Everything else (login, EPG, category lists, account info) still goes directly to the upstream — MediaFlow is only in the data path.
Configure a proxy¶
- Open the proxy.
- Set MediaFlow ON.
- Enter the MediaFlow URL (e.g.
http://mediaflow:8800). - Save and verify with the built-in player.
Run MediaFlow alongside tunlx¶
If you're running Tailnet-only access, put MediaFlow on
the same network_mode: service:tailscale namespace so the bridge URL
resolves the same way for tunlx:
Defaults via env vars¶
Set platform-wide defaults so individual proxies don't need to repeat them:
| Variable | Purpose |
|---|---|
TUNLX_MEDIAFLOW_BASE_URL |
Fallback mediaFlowURL when a proxy doesn't override it. |
API_PASSWORD |
API password used for MediaFlow calls if not embedded in the URL. |
MEDIAFLOW_API_PASSWORD |
Fallback if API_PASSWORD is unset. |
Verify it's actually in the path¶
After enabling:
# Should answer (from the host; inside the tunlx container use http://mediaflow:8800)
curl -s http://localhost:8800/health
# Should see a request flagged through /proxy/stream or /proxy/hls
docker logs --tail=50 mediaflow
In the dashboard's Activity & Telemetry, the proxy row will show a
MediaFlow badge so you can confirm at a glance.
When not to use MediaFlow¶
redirectStreamsmode (302 to upstream) — tunlx steps out of the data path entirely. MediaFlow can't see traffic it never receives.- Already-fast upstreams — added hop, added complexity, no payoff.
- Strict per-client-IP origins — MediaFlow becomes the client IP from the upstream's point of view.
Related¶
- Configuration Reference → MediaFlow
- Anti-block toolkit for upstream-quirk handling
- Architecture for the request-flow diagram