docs/commands/domains.md
f domainsManage shared local *.localhost routing with a single proxy on port 80.
Without this, each repo can start its own proxy and race for port 80.
f domains centralizes ownership with one engine at a time.
State lives in:
~/.config/flow/local-domains/routes.json~/.config/flow/local-domains/docker (default): shared nginx container (flow-local-domains-proxy)native (experimental): local C++ daemon (domainsd-cpp)Select engine per command:
f domains --engine docker up
f domains --engine native up
Or via env:
export FLOW_DOMAINS_ENGINE=native
f domains list
f domains add linsa.localhost 127.0.0.1:3481
f domains rm linsa.localhost
f domains up
f domains down
f domains doctor
f domains --engine native up
f domains --engine native down
f domains --engine native doctor
f domains up
:8080f domains add
host ends with .localhosthost:port--replacef domains doctor
80clang++ to build tools/domainsd-cpp/domainsd.cpp.503) and upstream timeout protection (504 on connect timeout).docs/local-domains-domainsd-cpp-spec.md.docs/myflow-localhost-runbook.md.[lifecycle.domains] and use f up / f down.If native startup fails with Permission denied on 127.0.0.1:80, install launchd socket mode once:
cd ~/code/flow
sudo ./tools/domainsd-cpp/install-macos-launchd.sh
Then run:
f domains --engine native up
This keeps routing fully native and avoids Docker overhead while still using port 80.
You can tune the native daemon at startup via environment variables:
FLOW_DOMAINS_NATIVE_MAX_ACTIVE_CLIENTS=128
FLOW_DOMAINS_NATIVE_UPSTREAM_CONNECT_TIMEOUT_MS=10000
FLOW_DOMAINS_NATIVE_UPSTREAM_IO_TIMEOUT_MS=15000
FLOW_DOMAINS_NATIVE_CLIENT_IO_TIMEOUT_MS=30000
FLOW_DOMAINS_NATIVE_POOL_MAX_IDLE_PER_KEY=8
FLOW_DOMAINS_NATIVE_POOL_MAX_IDLE_TOTAL=256
FLOW_DOMAINS_NATIVE_POOL_IDLE_TIMEOUT_MS=15000
FLOW_DOMAINS_NATIVE_POOL_MAX_AGE_MS=120000
Instead of per-repo docker proxy tasks:
[[tasks]]
name = "domains-up"
command = "f domains add myapp.localhost 127.0.0.1:3000 && f domains up"
This keeps one proxy process for all repos and avoids accidental domain hijacking.