Expand description
RedWire — RedDB’s binary TCP / TLS wire protocol with auth handshake, multiplex, compression, and version negotiation.
See docs/adr/0001-redwire-tcp-protocol.md. The protocol is
gated on a 0xFE startup magic byte so the listener can share
a port with HTTP and gRPC behind the service router.
Layered API:
frame— frame struct + MessageKind + flagscodec— encode/decode (16-byte header + payload)auth— handshake state machinesession— per-connection dispatch looplistener— TCP / TLS / Unix accept
Modules§
- auth
- Handshake state machine + auth method dispatch.
- codec
- Re-export of the canonical RedWire codec from
reddb-wire. - frame
- Re-export of the canonical RedWire frame types from
reddb-wire. - listener
- TCP / TLS / Unix listeners for the RedWire protocol.
- session
- Per-connection RedWire session: handshake → frame loop → bye.
Structs§
- Flags
- Frame
- Frame
Builder - Builder for server-emitted
Frames. - RedWire
Config
Enums§
- Build
Error - Errors surfaced at
build()time so they fail at construction rather than at encode time, where the call site has already lost the context to recover. - Frame
Error - Message
Kind - Single-byte message-kind discriminator. Numeric values are part of the wire spec — never repurpose a value once shipped.
Constants§
- DEFAULT_
REDWIRE_ PORT - Default port for the RedWire listener.
- FRAME_
HEADER_ SIZE - MAX_
FRAME_ SIZE - MAX_
KNOWN_ MINOR_ VERSION - Highest minor version the server supports. Wire-bumped as we
add features that change the handshake; data-plane additions
flow through
Hello.featuresinstead. - REDWIRE_
MAGIC - Discriminator byte every RedWire client sends as the very first byte off the wire. The service-router detector keys off this (and so does the standalone listener path).
Functions§
- decode_
frame - encode_
frame - start_
redwire_ listener - Start a plain-TCP RedWire listener on the configured bind addr.
- start_
redwire_ listener_ on - Start a RedWire listener on an already-bound TCP listener (used by the service router which owns the public socket and proxies to a loopback redwire backend).
- start_
redwire_ tls_ listener - Start a RedWire listener wrapped in TLS.
- start_
redwire_ unix_ listener - Start a RedWire listener on a Unix domain socket.