Open the relay connection and resolve with the server's SessionInfo
once the join is confirmed.
Transport selection (options.transport, default 'auto'):
WebTransport is tried first when available; any non-auth connect
failure falls through to WebSocket, which then gets the retry ladder.
WebTransport deliberately gets a single attempt in auto mode — its
connect failures are almost always environmental (UDP/QUIC blocked),
where retries only delay the transport that will actually work.
Auth failures (401/403) surface immediately and never fall back.
Close the connection, drop subscribers, and release resources. Idempotent.
Fire-and-forget publish. The 4-byte sender session ID is stamped by the server, so the wire payload is just the encoded envelope.
Subscribe to a topic. Returns an unsubscribe function. Multiple subscribers per topic are supported and dispatched in registration order.
Which transport the current connection uses, or null before connect.