mod.rs
1 //! Relay server protocol and client. 2 //! 3 //! This module implements the relay protocol for asynchronous message delivery. 4 //! Relay servers act as message stores, allowing messages to be delivered even 5 //! when the recipient is offline. 6 //! 7 //! # Architecture 8 //! 9 //! ```text 10 //! ┌─────────────────────────────────────────────────────────────┐ 11 //! │ Relay Protocol │ 12 //! │ - WebSocket-based communication │ 13 //! │ - Public key registration for mailboxes │ 14 //! │ - End-to-end encrypted message storage │ 15 //! └─────────────────────────────────────────────────────────────┘ 16 //! │ 17 //! ┌───────────────┼───────────────┐ 18 //! ▼ ▼ ▼ 19 //! ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ 20 //! │ Register │ │ Send │ │ Fetch │ 21 //! │ (mailbox) │ │ (relay) │ │ (retrieve) │ 22 //! └─────────────┘ └─────────────┘ └─────────────┘ 23 //! ``` 24 //! 25 //! # Security Model 26 //! 27 //! - Messages are end-to-end encrypted before reaching the relay 28 //! - Relay sees only: sender public key, recipient public key, encrypted blob 29 //! - Relay cannot read message contents 30 //! - DHT stores relay locations, not messages 31 32 pub mod client; 33 pub mod gossip; 34 pub mod protocol; 35 36 pub use client::{RelayClient, RelayError}; 37 pub use gossip::{BloomFilter, GossipHandler, GossipResponseResult}; 38 pub use protocol::{GossipForwardedMessage, RelayMessage, StoredMessage};