Proxy

Proxy configuration#

Every setting is optional — the proxy runs correctly with no .env at all. To change something:

cp .env.example .env
VariableDefaultWhat it does
PORT3000Port to listen on.
MAX_CONCURRENT_FETCHES500Upstream fetches in flight at once. Lower it if the host runs out of sockets or memory.
DISABLE_STREAMINGfalsetrue turns off /stream and /fragment, leaving only the plain destination proxy on /.
PROBE_HEADERS_TIMEOUT_MS6000How long to wait for response headers on a reachability probe.
PROXY_HEADERS_TIMEOUT_MS12000Same, for everything else on /.
PROXY_PLAYBACK_TIMEOUT_MS20000Playlists 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