Expand description
A client’s connection to the teter relay, over ws:// or wss://, and
the protocol messages sent and received on it. Shared by the backend and
the frontend.
Modules§
- account
- The client side of accounts: the crypto (
teter_core::account, re-exported here) and the requests to the relay’s account service (teter_common::account), with a machine’s authentication. - command
- The device’s side of commands to a machine (#88): see
teter_common::command. Split in steps so a caller (or a test) can hold a challenge, a sealed command and the channel apart. - e2e
- End-to-end encryption between backend and frontend: the relay forwards
terminal data it cannot read. See
docs/architecture.md, “End-to-end encryption”, for the design. - history
- A session’s history kept on disk across restarts (#93), as a frontend
gets it: the machine seals each chunk of what its terminal printed to the
account’s public keys (
crate::account::seal_towithCHUNK_INFO), so it can write them but not read them back; after a restart, the session process sends the chunks it kept before, unopened, with the time it started and its screen, in one replay of kindcrate::e2e::Kind::History; the device opens the chunks with the account’s private key. - sessions
- The account’s machines and sessions as the relay lists them (#87,
#133), checked and opened with the account’s keys: what a device may
trust of a
Sessionsanswer, never the relay’s word.
Traits§
- Io
- A byte stream: plain TCP, or TLS over TCP.
Functions§
- connect
- Connect to
url(ws://host:port/pathorwss://...). Forwss://, the relay’s certificate must chain to the system’s roots, or toca_cert(a PEM file) when given. - recv
- The next protocol message on
stream(aRelay, or its receiving half), orNoneonce the relay closed the connection. - send
- Send one protocol message on
sink(aRelay, or its sending half).
Type Aliases§
- Relay
- A WebSocket connection to the relay.