truffle_core/network/tailscale/mod.rs
1//! Tailscale network provider implementation.
2//!
3//! This module contains `TailscaleProvider`, which implements [`NetworkProvider`]
4//! using a Go sidecar (tsnet) and a local TCP bridge for data plane connections.
5//!
6//! ## Internal architecture (Layers 1-2, invisible above Layer 3)
7//!
8//! - **Sidecar** (`sidecar.rs`): Spawns the Go process, sends JSON commands via
9//! stdin, receives JSON events via stdout.
10//! - **Bridge** (`bridge.rs`): Listens on a local TCP port. The Go sidecar connects
11//! back to this port with a binary header to bridge Tailscale TCP streams.
12//! - **Header** (`header.rs`): Binary header format for bridge connections
13//! (magic, version, session token, direction, port, request ID, etc.).
14//! - **Protocol** (`protocol.rs`): JSON command/event types for sidecar communication.
15//!
16//! Only [`TailscaleProvider`] and [`TailscaleConfig`] are public. Everything else
17//! is an implementation detail.
18
19mod bridge;
20mod header;
21mod protocol;
22mod provider;
23mod sidecar;
24
25#[cfg(test)]
26mod tests;
27
28pub use provider::{TailscaleConfig, TailscaleProvider};