Expand description
TUN tunnel loop — intercepts all TCP flows and relays them through the proxy chain.
§Architecture
A dedicated OS thread runs the smoltcp poll loop (because TunTapInterface is not
Send). For every new TCP connection that appears on the TUN device, the poll loop
spawns an async relay task via a Tokio Handle.
Data flows between the poll loop and relay tasks through tokio::sync::mpsc channels:
TUN fd ──packets──► IpDevice ──► smoltcp::Interface::poll()
│
┌──────────────────┘
│ per-flow mpsc channels
▼
relay_flow() ──► ChainEngine::connect() ──► proxyRe-exports§
pub use crate::chain::ChainConfig;
Structs§
- Proxy
Chain Tunnel - Intercepts all TCP flows arriving on a TUN device and relays them through the configured proxy chain.
- Tunnel
Config - Configuration for
ProxyChainTunnel.