Charon is the relay backend of the Veil project. It lets clients running different messenger apps exchange messages with each other by acting as a neutral, anonymous relay: the server routes messages between addresses, but it never has access to their plaintext content.
- Registration — a client connects over WebTransport and registers with
an address (
token) and adevice_id. The server keeps a live session (Client) for that pair for as long as the connection is open. - Message relaying — a client sends a message addressed to a destination
address (
src→dst). Charon looks up all currently connected sessions for that destination and forwards the message to them directly. - Offline storage — if the destination has no active session, the message is queued in in-memory storage and delivered once that address reconnects.
Message payloads are treated as opaque bytes (Vec<u8>) end to end — Charon
never parses or inspects their content, it only reads the src/dst
addresses needed to route them.
- Transport: WebTransport,
via the internal
wt-server/wt-clientcrates. - Routes (
src/routes):register— client registration (AuthorizationRoute).message— message send/relay (MessageRoute).
- Services (
src/services):authorization— registers a client'swt-clientsession under aCId { token, device_id }.clients_manager— in-memory registry of live client sessions, keyed byCId, looked up by destination address.message— decides whether to forward a message to a live session or queue it in storage.message_storage— in-memory store of undelivered messages per destination address.veil_client— the outbound side, used to push a message over an existing session and get back a response.