Skip to main content

Module bridge

Module bridge 

Source
Expand description

The long-lived bridge server.

A WebSocket plane the browser connects to and an HTTP control plane the operator drives, joined by an id-keyed correlator.

A request flows: control plane (authenticated) → assign id + register a oneshot waiter → serialise a Command frame → WebSocket → browser fetch()BrowserReply frame → correlator resolves the waiter by id → control plane returns the HTTP response.

Structs§

BridgeConfig
Resolved runtime configuration for a bridge instance.
BridgeServer
A running bridge instance: both loopback-TCP planes bound and serving, with a CancellationToken for graceful shutdown.

Constants§

DEFAULT_CONTROL_PORT
Default HTTP control-plane port.
DEFAULT_MAX_BODY_BYTES
Default maximum browser response body size (8 MiB).
DEFAULT_MAX_CONCURRENT
Default maximum concurrent in-flight requests.
DEFAULT_TIMEOUT_SECS
Default per-request timeout, in seconds.
DEFAULT_WS_PORT
Default WebSocket-plane port.

Functions§

run
Binds both planes (fail-closed) and serves until the process is stopped.