WebSocketActorSettings
Defined in: src/io/broker/WebSocketActor.ts:13
Common settings every broker actor accepts on top of its protocol-
specific options. Subclasses extend this interface with their own
required fields (e.g. brokerUrl, topics).
Extends
Section titled “Extends”Properties
Section titled “Properties”circuitBreaker?
Section titled “circuitBreaker?”
readonlyoptionalcircuitBreaker?:object
Defined in: src/io/broker/BrokerSettings.ts:28
Optional circuit-breaker around connectImpl. After
failureThreshold consecutive failed connect attempts the breaker
opens for resetMs and rejects new attempts immediately.
failureThreshold
Section titled “failureThreshold”
readonlyfailureThreshold:number
resetMs
Section titled “resetMs”
readonlyresetMs:number
Inherited from
Section titled “Inherited from”BrokerCommonSettings.circuitBreaker
headers?
Section titled “headers?”
readonlyoptionalheaders?:Readonly<Record<string,string>>
Defined in: src/io/broker/WebSocketActor.ts:19
Custom request headers (Node only — browsers ignore these).
maxInboundFrameBytes?
Section titled “maxInboundFrameBytes?”
readonlyoptionalmaxInboundFrameBytes?:number
Defined in: src/io/broker/WebSocketActor.ts:37
Maximum allowed size of a single inbound frame, in bytes.
Frames larger than this are dropped (logged at warn level)
without being forwarded to target. Default: 1 MiB.
Why this exists (security): a malicious (or compromised) WS
peer can send arbitrarily-large frames. Without a cap, the
actor’s mailbox grows unbounded if target consumes slowly —
one 100-MiB frame plus a stalled consumer exhausts the process.
Set to Infinity to disable (not recommended for public-facing
endpoints); raise the cap if you legitimately need bigger
frames (audio/video streams).
outboundBuffer?
Section titled “outboundBuffer?”
readonlyoptionaloutboundBuffer?:number
Defined in: src/io/broker/BrokerSettings.ts:41
Maximum number of outbound messages buffered while the connection
is connecting or disconnected. When the buffer is full the
oldest message is dropped (FIFO eviction) and a
BrokerBufferOverflow event is published. Default: 1000. Set
to 0 to fail-fast (publish a BrokerNotConnected event and drop
the message).
Inherited from
Section titled “Inherited from”BrokerCommonSettings.outboundBuffer
pingIntervalMs?
Section titled “pingIntervalMs?”
readonlyoptionalpingIntervalMs?:number
Defined in: src/io/broker/WebSocketActor.ts:23
Send a ping every pingIntervalMs to keep the connection alive. Default: disabled.
protocols?
Section titled “protocols?”
readonlyoptionalprotocols?:string| readonlystring[]
Defined in: src/io/broker/WebSocketActor.ts:17
Subprotocols negotiated with the server.
reconnect?
Section titled “reconnect?”
readonlyoptionalreconnect?:false| {factor?:number;initialDelayMs?:number;maxAttempts?:number;maxDelayMs?:number; }
Defined in: src/io/broker/BrokerSettings.ts:15
Reconnect strategy applied when the underlying connection drops or
connectImpl throws. Default: exponential backoff starting at
200ms, doubling, capped at 30s, infinite attempts. Set to
false to disable auto-reconnect (one-shot connections).
Union Members
Section titled “Union Members”false
Type Literal
Section titled “Type Literal”{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }
factor?
Section titled “factor?”
readonlyoptionalfactor?:number
initialDelayMs?
Section titled “initialDelayMs?”
readonlyoptionalinitialDelayMs?:number
maxAttempts?
Section titled “maxAttempts?”
readonlyoptionalmaxAttempts?:number
Cap on retry attempts. Default: Infinity (retry forever).
maxDelayMs?
Section titled “maxDelayMs?”
readonlyoptionalmaxDelayMs?:number
Inherited from
Section titled “Inherited from”BrokerCommonSettings.reconnect
target?
Section titled “target?”
readonlyoptionaltarget?:ActorRef<WebSocketFrame>
Defined in: src/io/broker/WebSocketActor.ts:21
Subscriber that receives every inbound frame. Required.
readonlyoptionalurl?:string
Defined in: src/io/broker/WebSocketActor.ts:15
WebSocket URL (ws://... or wss://...).