Proxy
Proxy configuration#
Every setting is optional — the proxy runs correctly with no .env at all.
To change something:
cp .env.example .env| Variable | Default | What it does |
|---|---|---|
PORT | 3000 | Port to listen on. |
MAX_CONCURRENT_FETCHES | 500 | Upstream fetches in flight at once. Lower it if the host runs out of sockets or memory. |
DISABLE_STREAMING | false | true turns off /stream and /fragment, leaving only the plain destination proxy on /. |
PROBE_HEADERS_TIMEOUT_MS | 6000 | How long to wait for response headers on a reachability probe. |
PROXY_HEADERS_TIMEOUT_MS | 12000 | Same, for everything else on /. |
PROXY_PLAYBACK_TIMEOUT_MS | 20000 | Playlists and segments on /stream and /fragment. |
Keep PROXY_PLAYBACK_TIMEOUT_MS generous. It is the difference between a
slow-but-alive CDN segment arriving late and the player treating the whole
source as dead mid-buffer.
Memory#
The proxy buffers response bodies, and video bodies are large. Give the container a hard memory limit — without one, a bad hour of buffered streams is what takes the host down rather than the proxy.
deploy:
resources:
limits:
memory: 640M