Expand description
Shared device-session server (C-5): transport-neutral /econ-v1/device-session/1.
Carriers implement SessionStreams + HostBus and call serve.
Pass WebRtcSignaling when the carrier can answer webrtc.signal/1
(iroh); otherwise that method is refused with unsupported_transport.
Iroh-specific pieces (QUIC ProtocolHandler, WebRTC media path, session
registry/push) stay in node-app-iroh.
Modules§
- caps
- Capability names the host bus is expected to map.
Structs§
- Ingress
Socket - Host-owned Unix socket that alone may attest device-session provenance.
- OpenOk
- Proven session identity after a successful
session.open/1. - Refusal
- A host refusal the device is allowed to see (
code+ public detail). - Session
- Verified (or renewed) session identity returned by the host bus.
Enums§
- Frame
Error - Errors from encoding/decoding a request frame.
- Open
Mode - Session mode after a successful open.
- Response
Error - Errors from decoding a response frame.
- Session
End - Why
crate::servereturned. - Session
Path - How the session reached the node (stamped on the ingress).
Constants§
- ALPN
- ALPN for
/econ-v1/device-session/1. - DEVICE_
CALL_ METHOD - A device calls a node service.
- HTTP_
REQUEST_ METHOD - One HTTP request on an authenticated session stream.
- MAX_
FRAME_ BYTES - Maximum size of a single wire frame.
- PATH_
HEADER - Path header stamped on every attested upstream request.
- RESPONSE_
STATUS_ ERR - Response status: error.
- RESPONSE_
STATUS_ OK - Response status: success.
- SESSION_
HEADER - Provenance header stamped on every attested upstream request.
- SESSION_
OPEN_ METHOD - First stream:
{credential}or{mode:renewal}. - SESSION_
RENEW_ METHOD - One-shot first stream:
{}→ a new credential, then connection close. - WEBRTC_
SIGNAL_ METHOD - WebRTC signaling on an authenticated session stream.
- WS_
STREAM_ METHOD - A live WebSocket bridge on an authenticated session stream.
Traits§
- HostBus
- The app’s bus to the host for device-session capabilities.
- Session
Streams - One authenticated peer connection (handshake already proved
Self::peer_key). - WebRtc
Signaling - Carrier-owned WebRTC signaling for
webrtc.signal/1.
Functions§
- decode_
request - Decode a request frame, borrowing the payload.
- decode_
response - Decode a response frame.
- encode_
http_ tunnel_ request - Encode an
http.request/1body for tests and carriers. - encode_
request - Encode
[u16 BE method_len][method][payload]. - encode_
response - Encode
[u8 status][body]. - peek_
method - Read only the method prefix; payload stays unread.
- serve
- Serve one authenticated peer connection until it ends.