Add multi-Worker support with balanced selection and per-Worker lazy failover
This change enables multiple Worker domains and adds lazy failover by temporarily removing failed Workers from rotation via cooldown.
-
CLI/config: multiple Worker domains
--cf-worker-domainnow accepts comma-separated values and repeated flags.TG_CF_WORKER_DOMAINnow supports multiple domains (comma-delimited).- Added normalized multi-domain accessor:
Config::cf_worker_domains().
-
Routing: balanced Worker selection
- Added
balanced_cf_workers(...)(round-robin start index per connection), reusing--cf-balance. - Worker attempts now iterate a rotated Worker list, preserving ordered fallback across all configured Workers.
- Added
-
Failover: lazy per-Worker cooldown
- Reworked Worker failure tracking from per-DC to per Worker domain.
- On Worker failure, only that Worker enters cooldown; other Workers remain eligible immediately.
-
Operational surface updates
- Startup logging now lists all configured Worker domains.
--checkprobes all configured Worker domains instead of a single Worker.- Docs updated to describe multi-Worker usage and balancing behavior.
# multiple workers, balanced first-try, ordered fallback
tg-ws-proxy \
--cf-worker-domain w1.user.workers.dev,w2.user.workers.dev \
--cf-balance