Interface: RelayServerOptions
@roomful/relay / RelayServerOptions
Interface: RelayServerOptions
Section titled “Interface: RelayServerOptions”Defined in: packages/relay/src/server.ts:172
Configures the public relay server.
Properties
Section titled “Properties”authorize()?
Section titled “authorize()?”
optionalauthorize: (context) =>boolean|void|Promise<boolean|void>
Defined in: packages/relay/src/server.ts:191
Runs custom authorization before accepting a peer.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”boolean | void | Promise<boolean | void>
authSecret?
Section titled “authSecret?”
optionalauthSecret:string
Defined in: packages/relay/src/server.ts:220
Enables built-in JWT authorization. When set, peers must present a valid
HS256 token signed with this secret unless a custom authorize/auth()
handler is configured.
corsOrigin?
Section titled “corsOrigin?”
optionalcorsOrigin:string
Defined in: packages/relay/src/server.ts:213
Restricts browser access by allowed origin. When set, HTTP responses carry
matching CORS headers and WebSocket upgrades from other browser origins are
rejected. Use '*' to allow any origin.
optionalhost:string
Defined in: packages/relay/src/server.ts:181
Selects the listening host.
managementApi?
Section titled “managementApi?”
optionalmanagementApi:object
Defined in: packages/relay/src/server.ts:248
Enables the management REST API at the given path prefix.
When set, the relay serves project/room/quota CRUD endpoints
at the specified prefix (e.g. /api/v1). Requires a store
and default quota values.
Example:
managementApi: { prefix: '/api/v1', defaults: { maxRooms: 100, maxPeersPerRoom: 250, ... },}defaults
Section titled “defaults”defaults:
RelayDefaults
prefix?
Section titled “prefix?”
optionalprefix:string
store?
Section titled “store?”
optionalstore:ManagementStore
maxConnections?
Section titled “maxConnections?”
optionalmaxConnections:number
Defined in: packages/relay/src/server.ts:186
Caps concurrent peer connections.
maxRooms?
Section titled “maxRooms?”
optionalmaxRooms:number
Defined in: packages/relay/src/server.ts:226
Caps the number of distinct rooms this relay instance will host. A join that would open a new
room beyond the cap is rejected with a ROOM_LIMIT error. Enforced per relay instance.
maxRoomSize?
Section titled “maxRoomSize?”
optionalmaxRoomSize:number
Defined in: packages/relay/src/server.ts:206
Caps the number of peers allowed in any single room. Applied as a hard
ceiling on top of the client-provided maxPeers.
messageRateLimit?
Section titled “messageRateLimit?”
optionalmessageRateLimit:RelayMessageRateLimit
Defined in: packages/relay/src/server.ts:232
Limits how many messages a single peer connection may send. Excess messages are rejected with
a RATE_LIMITED error instead of being processed. Off by default.
port:
number
Defined in: packages/relay/src/server.ts:176
Selects the listening port.
redisUrl?
Section titled “redisUrl?”
optionalredisUrl:string
Defined in: packages/relay/src/server.ts:200
Experimental
Enables Redis coordination across relay instances.
Multi-instance/Redis coordination is experimental. Its semantics (e.g. rejecting joins while Redis is unavailable) may change before being declared stable.