Skip to main content

EgressGate

Type Alias EgressGate 

Source
pub type EgressGate = Arc<dyn Fn(StreamKey, Option<String>, Option<SocketAddr>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Send + Sync>;
Expand description

Decides whether a playback (egress/pull) request for a stream is allowed.

Server-side egress handlers (RTSP PLAY, SRT m=request, RTMP play) consult this before serving a player. The closure receives the stream key, the presented play token (None = none presented), and the player’s peer address (None when the transport exposes none) — so the host can check the per-app egress toggle, verify the token, and bind the token to the client IP. Returns a future resolving to true to allow. Async so the host can load per-app settings from a database. When no gate is installed, egress is open (permit-all), matching the authenticator’s default-permit philosophy.

Aliased Type§

pub struct EgressGate { /* private fields */ }