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
42
43
44
45
46
47
48
49
50
51
52
//! WebSocket transport layer.
//!
//! This module handles communication between local end (Rust) and
//! remote end (Extension) via WebSocket.
//!
//! See ARCHITECTURE.md Section 3 for transport specification.
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ ConnectionPool │
//! │ (single port) │
//! │ ┌─────────────────────────────────────────────────────┐ │
//! │ │ SessionId=1 → Connection 1 ──► Firefox 1 │ │
//! │ │ SessionId=2 → Connection 2 ──► Firefox 2 │ │
//! │ │ SessionId=3 → Connection 3 ──► Firefox 3 │ │
//! │ └─────────────────────────────────────────────────────┘ │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Connection Lifecycle
//!
//! 1. `ConnectionPool::new` - Bind to localhost with random port
//! 2. Launch Firefox with extension and WebSocket URL
//! 3. Pool accepts connection, waits for READY with SessionId
//! 4. `Connection` - Send commands, receive responses/events
//! 5. `ConnectionPool::remove` - Clean up on window close
//!
//! # Modules
//!
//! | Module | Description |
//! |--------|-------------|
//! | `connection` | WebSocket connection and event loop |
//! | `pool` | Connection pool for multiplexed connections |
// ============================================================================
// Submodules
// ============================================================================
/// WebSocket connection and event loop.
/// Connection pool for multiplexed WebSocket connections.
// ============================================================================
// Re-exports
// ============================================================================
pub use ;
pub use ConnectionPool;