Idle time with no body bytes. A client that sends no request body
bytes for this long gets 408 Request Timeout. A slow but steady
upload is fine. It stops clients that hold a connection open.
Native server only. Default 120 seconds.
gzip responses on a Rust thread of the native server. Off by default.
Streamed responses are not compressed. It costs CPU on every response.
Let the proxy do it when you have one.
Fills the container: registerContainer from
lib/generated/container.g.dart. Every isolate runs it, so each one has its
own instances. It also gives the routers, providers and model
binders that dox_builder found.
A keep-alive connection with no new request for this long is closed.
A request head must also come whole in this time. Behind a load
balancer, set it longer than the idle timeout of the balancer (eg.
65 seconds for AWS ALB, which keeps connections for 60 seconds).
Else Dox may close a connection the balancer still uses, and clients
get 502. Default 30 seconds.
The most connections one isolate holds open at once. Must be 1 or
more. 0 or less throws an ArgumentError when the server starts.
When an isolate is full, it stops accepting until one closes.
WebSocket connections and connections that are still closing count
too. New clients wait in the OS listen queue. It holds up to 1024
clients, and the OS can make it smaller (somaxconn; 128 by default
on macOS). When the queue is full, new clients wait and then time
out. On Linux each new client goes to one isolate (SO_REUSEPORT),
so it can wait for a full isolate even when others have room. The
limit is per isolate, so the
whole app holds up to maxConnections * totalIsolate. Keep that
below the file limit of the process (ulimit -n). Native server
only. Default null: no limit.
Old APP_KEYs, to change the key without logging out every user.
Encrypted cookies and cookie sessions made with one of them can
still be read. New ones are made with appKey only. Remove an old
key once its cookies have expired.
Providers to run at start, in every isolate. You can leave it empty:
every class that extends DoxProvider is in
lib/generated/container.g.dart. A provider listed here runs first.
Routers to register. You can leave it empty: every class that
extends Router is in lib/generated/container.g.dart. A router listed here
comes first, in this order.
On SIGTERM or SIGINT the server stops taking new connections, and
waits this long for open requests to finish. Then it closes the rest,
runs shutdown() of every provider and exits. Default 8 seconds. Keep it
below the kill timeout of your platform (docker stop: 10 seconds).
IPs or CIDR ranges of reverse proxies (nginx, Caddy, load balancer)
that Dox trusts. Only when the direct client is in this list does Dox
read X-Forwarded-For for req.ip() and X-Forwarded-Proto for
req.scheme(). Use ['*'] to trust any direct client, but only the
last X-Forwarded-For hop (only safe when the app port is not
reachable from outside). Empty by default.
Turns on the Origin check for every Route.websocket route.
Off (null) by default: any site can open a socket from a browser,
with the cookies of the user. Set it to only allow pages of the same
host and the sites in the list, like ['https://app.example.com'].
[] means the same host only. Other origins get 403. The
allowedOrigins of a route wins over this.