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.
ALLOWED_ORIGINSallSites allowed to use the proxy, comma-separated.
MAX_CONCURRENT_FETCHES500Requests in flight at once. Lower it if memory runs out.
DISABLE_STREAMINGfalsetrue turns off video playback and serves only /.
PROXY_PLAYBACK_TIMEOUT_MS20000How long to wait for a video server, in ms.

Keep PROXY_PLAYBACK_TIMEOUT_MS generous. A slow video server that answers late still plays, one that times out looks dead to the player.

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