Skip to main content

Module protocol

Module protocol 

Source
Expand description

Wire-protocol types for the browser bridge.

Three layers share these structs. The control plane accepts a ControlRequest body on POST /__bridge/request (and synthesises one for the transparent proxy). The WebSocket plane serialises a Command to the browser and deserialises a BrowserReply back. The control plane then returns a ResponseEnvelope to the caller. Every frame is newline-free JSON correlated by a monotonic integer id assigned by the server; the browser echoes it back unchanged.

Structs§

BrowserFrame
Browser → server frame: a superset of BrowserReply plus the streaming fields (stream/chunk/seq/done).
BrowserReply
Browser → server reply frame.
CancelCommand
Server → browser cancellation frame.
Command
Server → browser command frame.
ControlRequest
A request as supplied by a control-plane caller (the POST /__bridge/request body, or synthesised from the path/method/headers of a transparent-proxy request).
ResponseEnvelope
Control-plane response envelope returned to the caller of POST /__bridge/request.
StatusResponse
GET /__bridge/status response body.
TabInfo
One connected tab, as reported by GET /__bridge/status.

Enums§

ReplyOutcome
Classified outcome of a BrowserReply.
StreamItem
One item of a streamed browser response, derived from a BrowserFrame when the registered waiter is a stream.
StreamLine
One NDJSON line of a streamed POST /__bridge/request response.