Class RendezvousProtocol

Namespace
Unity.Multiplayer.Core

The self-hosted rendezvous service's wire protocol (RFC 0001): its routes, header and JSON field names, shared by the server (server/Rendezvous) and the adapter's client (UM-T13) so the two cannot drift apart. The service maps a JoinCode to a dedicated server's address and port; it does not get through NAT, so listen servers use Relay instead.

public static class RendezvousProtocol
Inheritance
RendezvousProtocol
Inherited Members

Remarks

POST /v1/registerBody {secret, address?, port, transport?}. 201 with {code, token, ttlSeconds, expiresAt}. An omitted address means "the address this request came from". 401 for a wrong secret, 400 for a bad endpoint, 503 when the store is full.
POST /v1/heartbeatBody {code, token}. 200 with the new {code, ttlSeconds, expiresAt}; 404 for an unknown or expired code or the wrong token.
GET /v1/resolve/{code}200 with {code, address, port, transport}; 400 (with error) for input that is not a join code, 404 for an unknown or expired one.
DELETE /v1/register/{code}Header TokenHeader. 204, or 404 for an unknown code or the wrong token.
GET /healthz200 "Healthy" while the service runs; never rate limited.

Every route may answer 429 when the caller's IP is over its rate limit. Error bodies are {error}.

Fields

HealthPath

GET: liveness probe for Docker and load balancers.

public const string HealthPath = "/healthz"

Field Value

string

HeartbeatPath

POST: keep a registration alive for another TTL.

public const string HeartbeatPath = "/v1/heartbeat"

Field Value

string

RegisterPath

POST: register a server and get its code.

public const string RegisterPath = "/v1/register"

Field Value

string

RegistrationPathPrefix

Prefix of DELETE /v1/register/{code}; see RegistrationPath(JoinCode).

public const string RegistrationPathPrefix = "/v1/register/"

Field Value

string

ResolvePathPrefix

Prefix of GET /v1/resolve/{code}; see ResolvePath(JoinCode).

public const string ResolvePathPrefix = "/v1/resolve/"

Field Value

string

TokenHeader

The header that carries a registration's token on DELETE.

public const string TokenHeader = "X-Rendezvous-Token"

Field Value

string

TransportUdp

Wire value of Udp.

public const string TransportUdp = "udp"

Field Value

string

TransportWebSocket

Wire value of WebSocket.

public const string TransportWebSocket = "websocket"

Field Value

string

Version

The protocol version, the first path segment of every API route.

public const string Version = "v1"

Field Value

string

Methods

RegistrationPath(JoinCode)

The path that deletes code's registration.

public static string RegistrationPath(JoinCode code)

Parameters

code JoinCode

Returns

string

Exceptions

ArgumentException

code is empty.

ResolvePath(JoinCode)

The path that resolves code.

public static string ResolvePath(JoinCode code)

Parameters

code JoinCode

Returns

string

Exceptions

ArgumentException

code is empty.

ToWire(TransportKind)

The wire value of transport.

public static string ToWire(TransportKind transport)

Parameters

transport TransportKind

Returns

string

Exceptions

ArgumentOutOfRangeException

transport is not a defined value.

TryParseTransport(string, out TransportKind)

Reads a wire transport value, ignoring case. Null or empty means Udp, the default.

public static bool TryParseTransport(string value, out TransportKind transport)

Parameters

value string
transport TransportKind

Returns

bool