Hyrouter is a stateless QUIC entrypoint and referral router for Hytale.
It accepts an incoming QUIC connection, extracts minimal metadata (TLS SNI + the first Connect packet), chooses a backend target using routing rules and optional plugins, sends a referral/redirect to the client, and closes the stream.
Hyrouter is not a reverse proxy and does not forward gameplay traffic.
- Stateless data plane (no required DB/Redis)
- Fail-safe routing (fallbacks or explicit deny)
- No gameplay proxying / forwarding
- Extensible policies via plugins (gRPC or WASM)
- CLI entrypoint:
cmd/hyrouter - Config loading + validation:
internal/config - Static routing engine (SNI-based):
internal/routing - Plugin system (ordering + backends):
internal/plugins - QUIC server + packet handling:
internal/server
- Client connects via QUIC and negotiates ALPN (configured via
tls.alpn; typicallyhytale/2). - Hyrouter obtains TLS metadata:
- remote address
- SNI (hostname)
- negotiated ALPN
- optional client certificate fingerprint
- Hyrouter decides an initial target using the routing engine (based on SNI).
- Hyrouter accepts a bidirectional QUIC stream and reads Hytale framed packets.
- Framing:
uint32le payloadLen+uint32le packetID+payload
- Framing:
- When the first
Connectpacket (packet ID0) is decoded:- Hyrouter extracts identity fields (username, uuid, language, ...).
- Hyrouter calls plugins (if configured).
- Result:
- If any plugin denies: Hyrouter sends
Disconnect(packet ID1) and closes the stream. - Otherwise, if a routing target is available: Hyrouter sends
ClientReferral(packet ID18) and closes the stream.
- If any plugin denies: Hyrouter sends
Plugins run sequentially with deterministic ordering:
- Stage order:
deny->route->mutate - Within each stage:
before/afterconstraints (topological sort)
Plugins can deny, override the target, or attach referral data.
See: