Interface: RelayServerOptions
@roomful/relay / RelayServerOptions
Interface: RelayServerOptions
Section titled “Interface: RelayServerOptions”Defined in: packages/relay/src/server.ts:150
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:169
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:194
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:187
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:159
Selects the listening host.
maxConnections?
Section titled “maxConnections?”
optionalmaxConnections:number
Defined in: packages/relay/src/server.ts:164
Caps concurrent peer connections.
maxRoomSize?
Section titled “maxRoomSize?”
optionalmaxRoomSize:number
Defined in: packages/relay/src/server.ts:180
Caps the number of peers allowed in any single room. Applied as a hard
ceiling on top of the client-provided maxPeers.
port:
number
Defined in: packages/relay/src/server.ts:154
Selects the listening port.
redisUrl?
Section titled “redisUrl?”
optionalredisUrl:string
Defined in: packages/relay/src/server.ts:174
Enables Redis coordination across relay instances.