Skip to main content

Module relay

Module relay 

Source
Expand description

The relay control protocol: the JSON messages a huddle client and a huddle-server relay exchange over the WebSocket door.

Extracted here so the client (huddle-core::network::server) and the relay (huddle-server) share ONE definition instead of the two hand-kept-in-sync copies they carried before. ClientMsg is what the client sends and the relay receives; ServerMsg is the reverse. Both derive Serialize + Deserialize so each side uses whichever direction it needs.

Wire-compat note: the field-level #[serde(default)] / skip_serializing_if attributes match the relay’s historical (authoritative) serialization, so these unified types are byte-identical to both prior copies — old clients and relays interoperate unchanged.

Enums§

ClientMsg
Client → relay. The client serializes these; the relay deserializes them, tolerating absent optional fields from older clients via serde(default).
ServerMsg
Relay → client. The relay serializes these; the client deserializes them.