Skip to content

@seydx/rtsp / RelayOptions

Interface: RelayOptions

Defined in: relay.ts:18

Options for relay creation.

Configures the single upstream source, its idle lifecycle, per-sink buffering, and startup behavior. Only source is required; the remaining fields tune how aggressively the relay holds the upstream open and how it copes with slow sinks.

Properties

autoStart?

optional autoStart?: boolean

Defined in: relay.ts:55

Open the upstream eagerly during construction instead of on the first sink.

When true the relay calls Relay.start immediately so the source is connected before any sink is piped; otherwise the upstream stays idle until the first Relay.pipe. Defaults to false.


idleTimeout?

optional idleTimeout?: number

Defined in: relay.ts:37

How long, in milliseconds, to keep the upstream alive after the last sink leaves before tearing it down.

When a positive value is given the relay waits that long before closing the source, letting a reconnecting client reuse the already-open upstream. A value of 0 (the default) stops the upstream immediately once the final sink detaches.


logger?

optional logger?: Logger

Defined in: relay.ts:64

Optional logger for diagnostic and error output.

Receives non-fatal warnings and errors raised while pumping the upstream, initializing sinks, or closing the source. Propagated to sinks created via Relay.serveRtsp. When omitted no diagnostics are emitted.


maxQueue?

optional maxQueue?: number

Defined in: relay.ts:46

Per-sink buffer depth, in packets, before backpressure kicks in.

Each sink has its own queue; when a sink falls behind and its queue exceeds this depth, packets are dropped and the sink is re-synced at the next keyframe rather than blocking the whole fan-out. Defaults to 512.


source

source: Source

Defined in: relay.ts:26

The single upstream that feeds every attached sink.

Exactly one connection to this source is held regardless of how many sinks are piped; the relay opens it lazily (or eagerly with autoStart) and fans each demuxed packet out to all ready consumers.