Hyrouter uses the TLS SNI (server name / hostname) observed during the QUIC handshake to choose a backend.
Routing is evaluated before plugins run. Plugins may still influence the chosen backend.
Routes support two match forms:
match.hostname– a single hostname patternmatch.hostnames– a list of hostname patterns
Patterns are matched using Go's path.Match semantics.
Examples:
- Exact host:
alpha.example.com - Wildcard subdomain:
*.example.com
Notes:
- Matching is case-insensitive.
- A trailing dot is ignored.
- Routes are evaluated in order; the first match wins.
A backend is a host/port pair (plus optional metadata). A pool groups multiple backends with a selection strategy.
hostmust be non-empty.portmust be between 1 and 65535.
Pool strategies:
round_robinrandomweighted(requiresweight > 0on each backend)least_loaded(requireskey)p2c(power-of-two-choices; requireskey, optionalsample)
Notes:
round_robincycles deterministically through the candidate list. This tends to distribute load evenly across backends.randompicks a backend uniformly at random from the candidate list. This is non-deterministic and may produce streaks.p2csamplessamplerandom candidates (default: 2) and chooses the one with the smallest numeric value forkey.
Pool selection controls:
pool.sortsorts candidates before load balancing.pool.limitoptionally caps the candidate set before load balancing.pool.filterscan filter candidates before sorting and selection.pool.fallbackdefines additional selection attempts if the initial filters yield no candidates.
Filters are evaluated against backend metadata and the decoded Connect request.
The whitelist filter is enabled per-backend via a metadata key and then checks whether the client is included in a backend-provided allowlist.
Fields:
enabled_key: backend meta key that toggles whitelist behavior (true/1/yesenables it)list_key: backend meta key holding the allowlist (JSON array or comma-separated list)subject: which client field to match against the allowlist (uuidorusername, default:uuid)
Example:
filters:
- type: whitelist
subject: uuid
enabled_key: annotation.agones.dev/sdk-whitelist-enabled
list_key: list.whitelistedPlayers.valuesA pool can optionally reference a discovery provider instead of (or in addition to) static backends.
pool.discovery.providerselects a configured provider (seedocs/configuration.md).pool.discovery.modecontrols how discovered backends interact with static backends:prefer: use discovered backends if any exist, otherwise fall back to static backendsunion: merge static + discovered backends
routing:
default:
strategy: round_robin
backends:
- host: play.hyvane.com
port: 5520
routes:
- match:
hostname: "alpha.example.com"
pool:
strategy: round_robin
backends:
- host: alpha-backend.internal
port: 5520
- match:
hostnames:
- "*.example.com"
- "example.net"
pool:
strategy: weighted
backends:
- host: wildcard-backend-a.internal
port: 5520
weight: 1
- host: wildcard-backend-b.internal
port: 5520
weight: 2
- match:
hostname: "play.example.com"
pool:
strategy: round_robin
sort:
- key: counter:players.count
type: number
order: asc
limit: 10
discovery:
provider: agones
mode: prefer- Plugins run after the first
Connectpacket has been decoded. - A plugin may return
backendto override the routing decision. - A plugin may return
selected_indexto pick a backend fromcandidates.
See: