1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Clasp Router
//!
//! The router is the central hub for Clasp communication:
//! - Manages client sessions
//! - Routes messages between clients
//! - Maintains parameter state
//! - Handles subscriptions
//! - Bridges to other protocols
//!
//! # Transport Support
//!
//! The router is transport-agnostic and can accept connections from:
//! - **WebSocket** (default): Universal, works in browsers and all platforms
//! - **QUIC**: High-performance native apps (requires UDP, not available on DO App Platform)
//!
//! # Example
//!
//! ```no_run
//! use clasp_router::{Router, RouterConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let router = Router::new(RouterConfig::default());
//!
//! // WebSocket on default port
//! router.serve_websocket("0.0.0.0:7330").await?;
//! Ok(())
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use RouterState;
pub use SubscriptionManager;