Skip to content

Interface: RoomRelayOptions<M>

Defined in: index.ts:113

Options for createRoomRelayBackend: the room knobs plus the delegate.

Extends

Type Parameters

M

M extends object

Properties

log?

optional log?: (line) => void

Defined in: index.ts:121

Line logger for lifecycle diagnostics (defaults to silent).

Parameters

line

string

Returns

void


logPrefix

logPrefix: string

Defined in: index.ts:97

Prefixes the registration log line ("<logPrefix>: host …").

Inherited from

RoomRelayDelegate.logPrefix


prefix?

optional prefix?: string

Defined in: index.ts:115

Path prefix all routes live under (e.g. "/pencil"). Default: none.


resolveChannel?

optional resolveChannel?: ChannelResolver

Defined in: index.ts:119

Resolve a host-announced channel port to { tag, project }.


session?

optional session?: object

Defined in: index.ts:117

Static session identity hosts inherit when they don't announce their own.

channelTag?

optional channelTag?: string

project?

optional project?: string

Methods

decode()

decode(text): M | undefined

Defined in: index.ts:99

Parse a text frame, or undefined for a malformed one.

Parameters

text

string

Returns

M | undefined

Inherited from

RoomRelayDelegate.decode


encode()

encode(message): string

Defined in: index.ts:101

Serialize a frame to text.

Parameters

message

M

Returns

string

Inherited from

RoomRelayDelegate.encode


joinedExtras()?

optional joinedExtras(info): Record<string, unknown>

Defined in: index.ts:105

Fields the joined frame carries beyond { host, label } (e.g. presentation).

Parameters

info

RoomSessionInfo

Returns

Record<string, unknown>

Inherited from

RoomRelayDelegate.joinedExtras


onClientMessage()

onClientMessage(message, ctx): void

Defined in: index.ts:109

Route a joined client's non-join/leave frame (forward up to the host).

Parameters

message

M

ctx

ClientMessageContext<M>

Returns

void

Inherited from

RoomRelayDelegate.onClientMessage


onHostMessage()

onHostMessage(message, ctx): void

Defined in: index.ts:107

Route a host's non-register frame (cache-and-fan-out, or client-directed).

Parameters

message

M

ctx

HostMessageContext<M>

Returns

void

Inherited from

RoomRelayDelegate.onHostMessage


registerExtras()?

optional registerExtras(message): Record<string, unknown>

Defined in: index.ts:103

Fields a register frame contributes to the session (e.g. presentation, channelTag).

Parameters

message

M

Returns

Record<string, unknown>

Inherited from

RoomRelayDelegate.registerExtras