ap_proxy/server/mod.rs
1//! Proxy server implementation.
2//!
3//! This module provides the server-side implementation of the ap-proxy server.
4//! The server can be run standalone using the binary, or embedded in custom applications.
5//!
6//! # Running as a Binary
7//!
8//! The simplest way to run the proxy server:
9//!
10//! ```bash
11//! cargo run --bin ap-proxy
12//! ```
13//!
14//! # Embedding in Your Application
15//!
16//! You can embed the proxy server in your own application:
17//!
18//! ```no_run
19//! use ap_proxy::server::ProxyServer;
20//! use std::net::SocketAddr;
21//!
22//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
23//! let addr: SocketAddr = "127.0.0.1:8080".parse()?;
24//! let server = ProxyServer::new(addr);
25//!
26//! // Run the server (blocks until shutdown)
27//! server.run().await?;
28//! # Ok(())
29//! # }
30//! ```
31//!
32//! # Server Responsibilities
33//!
34//! The proxy server:
35//! - Accepts WebSocket connections from clients
36//! - Authenticates clients using MlDsa65 challenge-response
37//! - Manages rendezvous codes for peer discovery
38//! - Routes messages between authenticated clients
39//! - Cleans up expired rendezvous codes automatically
40//!
41//! # Security Considerations
42//!
43//! The server operates as a zero-knowledge proxy:
44//! - Verifies client identities via cryptographic signatures
45//! - Routes messages based on fingerprints
46//! - Does not decrypt or inspect message payloads
47//! - Sees metadata: source, destination, timing, message size
48
49mod handler;
50mod proxy_server;
51
52pub use proxy_server::ProxyServer;