srx/lib.rs
1//! # SRX — Stochastic Routing eXtended
2//!
3//! A next-generation VPN protocol is designed around three pillars:
4//!
5//! 1. **Stealth** — DPI evasion through protocol mimicry, jitter modeling,
6//! cover traffic, and elimination of static signatures.
7//!
8//! 2. **Resilience** — Multi-transport channel splitting with stochastic
9//! routing, automatic fallback, and self-healing under interference.
10//!
11//! 3. **Cryptographic strength** — Hybrid post-quantum (Kyber) + ECDH
12//! key exchange, AEAD encryption, deterministic seed-based coordination,
13//! and pseudo-random re-keying.
14//!
15//! ## Architecture overview
16//!
17//! ```text
18//! ┌─────────────────────────────────────────────────┐
19//! │ Application │
20//! ├─────────────────────────────────────────────────┤
21//! │ Session (handshake, re-key, seed sync) │
22//! ├─────────────────────────────────────────────────┤
23//! │ Frame (encode/decode, fragment/reassemble) │
24//! ├──────────┬──────────────────────────────────────┤
25//! │ Routing │ Masking (mimicry, jitter, cover) │
26//! ├──────────┴──────────────────────────────────────┤
27//! │ Channel (multiplex, fallback, health) │
28//! ├─────────────────────────────────────────────────┤
29//! │ Transport (TCP, UDP, QUIC, WS, gRPC, HTTP) │
30//! ├─────────────────────────────────────────────────┤
31//! │ Crypto (PQC-KEM, ECDH, AEAD, KDF) │
32//! └─────────────────────────────────────────────────┘
33//! ```
34
35pub mod channel;
36pub mod client;
37pub mod config;
38pub mod crypto;
39pub mod error;
40pub mod frame;
41pub mod high_api;
42pub mod masking;
43pub mod metrics;
44pub mod node;
45pub mod pipeline;
46pub mod replay_storage;
47pub mod routing;
48pub mod seed;
49pub mod server;
50pub mod session;
51pub mod signaling;
52pub mod transport;
53
54// Re-export key types at crate root for convenience.
55pub use config::SrxConfig;
56pub use crypto::AeadPipeline;
57pub use error::{Result, SrxError};
58pub use frame::{read_length_prefixed, write_length_prefixed};
59pub use high_api::SecureTcpSession;
60pub use node::SrxNode;
61pub use pipeline::{Payload, SrxPipeline};
62pub use replay_storage::{
63 CustomHmacKeyProvider, ReplayStoreMetricsSnapshot, register_custom_hmac_key_provider,
64};
65pub use session::Session;
66pub use signaling::inband::Signal;
67pub use transport::{
68 ReconnectConfig, ReconnectingTransport, TcpTransport, TimeoutTransport, TlsTcpTransport,
69 TransportManager, UdpTransport,
70};
71
72#[cfg(feature = "http-tunnel")]
73pub use transport::HttpTunnelTransport;
74#[cfg(feature = "websocket")]
75pub use transport::WebSocketTransport;
76#[cfg(feature = "grpc")]
77pub use transport::{GrpcTransport, TunnelEcho, serve_tunnel_echo, serve_tunnel_echo_tls};
78#[cfg(feature = "quic")]
79pub use transport::{QuicStreamChannel, QuicTransport};