Replace per-SOCKS-request HTTPS connections with persistent multiplexed tunnel session

- Introduce TunnelSession that holds a single authenticated SendRequest
  shared across all concurrent SOCKS5 streams via Arc<Mutex<>>
- Connector authenticates once on startup, then reuses the persistent
  tunnel for all SOCKS5 CONNECT requests
- Listener /forward returns raw bytes (no HTTP parse/unparse overhead)
  to preserve exact byte semantics for SOCKS5 TCP proxying
- Add stream counters (session-X) for logging and isolation tracking
- Add 5 new tests: sequential streams, concurrent streams with isolation,
  stream counter increments, pre-auth rejection, and E2E concurrent SOCKS5
  streams over a shared tunnel
- All 117 tests pass; E2E CLI validates 5 concurrent streams share one
  persistent TLS connection (127.0.0.1:64216 in transcript)
This commit is contained in:
c4ch3c4d3
2026-06-03 20:17:39 -06:00
parent 6466753176
commit f871ba7f7b
2 changed files with 876 additions and 140 deletions
+3
View File
@@ -40,6 +40,9 @@ pub enum AuthError {
#[error("auth token invalid")] #[error("auth token invalid")]
Invalid, Invalid,
#[error("auth not yet completed")]
NotAuthenticated,
#[error("auth token expired")] #[error("auth token expired")]
#[allow(dead_code)] #[allow(dead_code)]
Expired, Expired,
+873 -140
View File
File diff suppressed because it is too large Load Diff