Hyrouter supports plugins that can influence connection handling after the client sends the first Hytale Connect packet (packet ID 0).
Plugins can:
- Deny a connection (Hyrouter replies with
Disconnect, packet ID1). - Override the selected routing backend.
- Attach referral content (forwarded into
ClientReferral, packet ID18).
Plugins are configured under the top-level plugins list in the Hyrouter config file.
Plugins are executed in two dimensions:
- Stage order:
deny->route->mutate - Within a stage: deterministic ordering using a topological sort over
before/afterconstraints.
If stage is omitted, it defaults to route.
Each plugin entry supports:
name(string, required)type(string, required):grpcorwasmstage(string, optional):deny,route,mutatebefore(list of string, optional): plugin names that should run after this pluginafter(list of string, optional): plugin names that should run before this plugin
grpc.address(string, required): address of the plugin server (for example127.0.0.1:7777)
plugins:
- name: deny-grpc
type: grpc
stage: deny
grpc:
address: 127.0.0.1:7777wasm.path(string, required): path to a.wasmfile
plugins:
- name: mutate-wasm
type: wasm
stage: mutate
wasm:
path: examples/wasm-plugin/plugin.wasmIf any plugin returns deny: true, Hyrouter:
- Sends a Hytale
Disconnectpacket. - Closes the QUIC stream.
A plugin may influence backend selection by setting one of:
backend(explicit host/port)selected_index(pick an entry from the currentcandidateslist)
A plugin may set referral_content in its response.
Hyrouter wraps this content into a fixed, versioned referral envelope and forwards it inside the ClientReferral packet.
- Each plugin call runs with a fixed timeout.
- If a plugin call returns an error or times out, Hyrouter logs it and continues with the next plugin.