# b3hnamr/eztunnel architecture

> Architecture diagram of the GitHub repository b3hnamr/eztunnel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/b3hnamr/eztunnel
- Repository: https://github.com/b3hnamr/eztunnel

## Overview

EZTunnel pairs two Linux servers to carry forwarded TCP/UDP, SOCKS5, or routed TUN traffic through an authenticated encrypted tunnel. Operators create and manage tunnels with the terminal manager or optional web dashboard; the transport checker measures candidate links, and the runtime connects peers and forwards traffic to destinations. The graph preserves documented transport, Mirage, and dashboard capabilities, but several backend and transport implementations were not excerpted, so their unverified links are dashed or omitted.

Main entry points: [`src/manager/mod.rs`](https://github.com/b3hnamr/eztunnel/blob/main/src/manager/mod.rs) (Terminal manager), [`src/engine.rs`](https://github.com/b3hnamr/eztunnel/blob/main/src/engine.rs) (Tunnel engine), [`src/config.rs`](https://github.com/b3hnamr/eztunnel/blob/main/src/config.rs) (Tunnel configuration), [`dashboard-ui/src/App.svelte`](https://github.com/b3hnamr/eztunnel/blob/main/dashboard-ui/src/App.svelte) (Dashboard interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator tools"]
  node_manager["Terminal manager<br/>[mod.rs]"]
  node_wizard["Tunnel planning<br/>[plan.rs]"]
  node_configstore[("Config and tunnel store<br/>[store.rs]")]
  node_service["Managed services<br/>[service.rs]"]
  node_checker["Transport checker<br/>[mod.rs]"]
end

subgraph group_dashboard["Web dashboard"]
  node_dashboardui["Dashboard interface<br/>[App.svelte]"]
  node_dashboardapi["Dashboard API client<br/>[api.js]"]
  node_dashboardserver["Dashboard server<br/>[http.rs]"]
  node_dashboardauth["Dashboard authentication<br/>[auth.rs]"]
  node_dashboardops["Dashboard operations<br/>[ops.rs]"]
end

subgraph group_runtime["Tunnel runtime"]
  node_config["Tunnel configuration<br/>[config.rs]"]
  node_engine["Tunnel engine<br/>[engine.rs]"]
  node_gaming["Gaming UDP channels<br/>[gaming.rs]"]
  node_stats["Tunnel statistics<br/>[stats.rs]"]
end

subgraph group_protocols["Transport and security"]
  node_carrier["Carrier transports<br/>[carrier.rs]"]
  node_transport["Transport security<br/>[transport.rs]"]
  node_tunnelkey["Tunnel key and identity<br/>[tunnel_key.rs]"]
  node_parallax["Parallax transport"]
  node_rawpacket["Raw packet transport<br/>[raw_packet.rs]"]
  node_spoof["Source spoofing<br/>[spoof.rs]"]
  node_spoofsession["Spoof sessions<br/>[spoof_session.rs]"]
  node_stealth["Stealth options<br/>[stealth.rs]"]
end

node_operator(("Server operator"))
node_peer(("Peer server"))
node_destination(("Destination service or network"))
node_browser(("Browser operator"))

node_operator -->|"configures tunnels"| node_manager
node_manager -->|"builds plans"| node_wizard
node_wizard -->|"produces config"| node_config
node_manager -->|"runs checks"| node_checker
node_manager -.->|"manages saved tunnels"| node_configstore
node_manager -.->|"starts services"| node_service
node_browser -->|"manages servers"| node_dashboardui
node_dashboardui -->|"requests dashboard data"| node_dashboardapi
node_dashboardui -->|"checks session"| node_dashboardauth
node_dashboardapi -.->|"calls dashboard"| node_dashboardserver
node_dashboardserver -.->|"authenticates requests"| node_dashboardauth
node_dashboardserver -.->|"dispatches operations"| node_dashboardops
node_dashboardops -.->|"manages tunnel state"| node_configstore
node_peer -->|"connects as tunnel peer"| node_engine
node_engine -->|"loads tunnel settings"| node_config
node_engine -->|"opens secure connections"| node_transport
node_engine -->|"uses carriers"| node_carrier
node_engine -->|"reports traffic"| node_stats
node_engine -->|"supports gaming channels"| node_gaming
node_engine -->|"forwards traffic"| node_destination
node_config -->|"uses tunnel identity"| node_tunnelkey
node_config -->|"configures stealth"| node_stealth
node_manager -->|"offers transport options"| node_parallax
node_config -->|"configures carrier"| node_parallax
node_config -->|"configures raw carrier"| node_rawpacket
node_config -->|"configures spoofing"| node_spoof
node_spoof -->|"uses raw packets"| node_rawpacket
node_manager -->|"sets up Mirage"| node_spoofsession
node_checker -->|"uses tunnel plans"| node_wizard

click node_manager "https://github.com/b3hnamr/eztunnel/blob/main/src/manager/mod.rs"
click node_wizard "https://github.com/b3hnamr/eztunnel/blob/main/src/manager/plan.rs"
click node_configstore "https://github.com/b3hnamr/eztunnel/blob/main/src/manager/store.rs"
click node_service "https://github.com/b3hnamr/eztunnel/blob/main/src/manager/service.rs"
click node_checker "https://github.com/b3hnamr/eztunnel/blob/main/src/checker/mod.rs"
click node_dashboardui "https://github.com/b3hnamr/eztunnel/blob/main/dashboard-ui/src/App.svelte"
click node_dashboardapi "https://github.com/b3hnamr/eztunnel/blob/main/dashboard-ui/src/lib/api.js"
click node_dashboardserver "https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/http.rs"
click node_dashboardauth "https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/auth.rs"
click node_dashboardops "https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/ops.rs"
click node_config "https://github.com/b3hnamr/eztunnel/blob/main/src/config.rs"
click node_engine "https://github.com/b3hnamr/eztunnel/blob/main/src/engine.rs"
click node_gaming "https://github.com/b3hnamr/eztunnel/blob/main/src/gaming.rs"
click node_stats "https://github.com/b3hnamr/eztunnel/blob/main/src/stats.rs"
click node_carrier "https://github.com/b3hnamr/eztunnel/blob/main/src/carrier.rs"
click node_transport "https://github.com/b3hnamr/eztunnel/blob/main/src/transport.rs"
click node_tunnelkey "https://github.com/b3hnamr/eztunnel/blob/main/src/tunnel_key.rs"
click node_parallax "https://github.com/b3hnamr/eztunnel/blob/main/src/parallax_carrier.rs"
click node_rawpacket "https://github.com/b3hnamr/eztunnel/blob/main/src/raw_packet.rs"
click node_spoof "https://github.com/b3hnamr/eztunnel/blob/main/src/spoof.rs"
click node_spoofsession "https://github.com/b3hnamr/eztunnel/blob/main/src/spoof_session.rs"
click node_stealth "https://github.com/b3hnamr/eztunnel/blob/main/src/stealth.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_wizard,node_configstore,node_service,node_checker,node_browser toneBlue
class node_dashboardui,node_dashboardapi,node_dashboardserver,node_dashboardauth,node_dashboardops toneAmber
class node_config,node_engine,node_gaming,node_stats,node_operator,node_peer toneMint
class node_carrier,node_transport,node_tunnelkey,node_parallax,node_rawpacket,node_spoof,node_spoofsession,node_stealth toneRose
class node_destination toneIndigo
```

## Components

### Operator tools

- [Terminal manager](https://github.com/b3hnamr/eztunnel/blob/main/src/manager/mod.rs): `src/manager/mod.rs`
- [Tunnel planning](https://github.com/b3hnamr/eztunnel/blob/main/src/manager/plan.rs): `src/manager/plan.rs`
- [Config and tunnel store](https://github.com/b3hnamr/eztunnel/blob/main/src/manager/store.rs): `src/manager/store.rs`
- [Managed services](https://github.com/b3hnamr/eztunnel/blob/main/src/manager/service.rs): `src/manager/service.rs`
- [Transport checker](https://github.com/b3hnamr/eztunnel/blob/main/src/checker/mod.rs): `src/checker/mod.rs`

### Web dashboard

- [Dashboard interface](https://github.com/b3hnamr/eztunnel/blob/main/dashboard-ui/src/App.svelte): `dashboard-ui/src/App.svelte`
- [Dashboard API client](https://github.com/b3hnamr/eztunnel/blob/main/dashboard-ui/src/lib/api.js): `dashboard-ui/src/lib/api.js`
- [Dashboard server](https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/http.rs): `src/dashboard/http.rs`
- [Dashboard authentication](https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/auth.rs): `src/dashboard/auth.rs`
- [Dashboard operations](https://github.com/b3hnamr/eztunnel/blob/main/src/dashboard/ops.rs): `src/dashboard/ops.rs`

### Tunnel runtime

- [Tunnel configuration](https://github.com/b3hnamr/eztunnel/blob/main/src/config.rs): `src/config.rs`
- [Tunnel engine](https://github.com/b3hnamr/eztunnel/blob/main/src/engine.rs): `src/engine.rs`
- [Gaming UDP channels](https://github.com/b3hnamr/eztunnel/blob/main/src/gaming.rs): `src/gaming.rs`
- [Tunnel statistics](https://github.com/b3hnamr/eztunnel/blob/main/src/stats.rs): `src/stats.rs`

### Transport and security

- [Carrier transports](https://github.com/b3hnamr/eztunnel/blob/main/src/carrier.rs): `src/carrier.rs`
- [Transport security](https://github.com/b3hnamr/eztunnel/blob/main/src/transport.rs): `src/transport.rs`
- [Tunnel key and identity](https://github.com/b3hnamr/eztunnel/blob/main/src/tunnel_key.rs): `src/tunnel_key.rs`
- [Parallax transport](https://github.com/b3hnamr/eztunnel/blob/main/src/parallax_carrier.rs): `src/parallax_carrier.rs`
- [Raw packet transport](https://github.com/b3hnamr/eztunnel/blob/main/src/raw_packet.rs): `src/raw_packet.rs`
- [Source spoofing](https://github.com/b3hnamr/eztunnel/blob/main/src/spoof.rs): `src/spoof.rs`
- [Spoof sessions](https://github.com/b3hnamr/eztunnel/blob/main/src/spoof_session.rs): `src/spoof_session.rs`
- [Stealth options](https://github.com/b3hnamr/eztunnel/blob/main/src/stealth.rs): `src/stealth.rs`

### Other components

- **Server operator**
- **Peer server**
- **Destination service or network**
- **Browser operator**

## Connections

- Server operator → Terminal manager: configures tunnels (evidence: `README.md`)
- Terminal manager → Tunnel planning: builds plans (evidence: `src/manager/mod.rs`)
- Tunnel planning → Tunnel configuration: produces config (evidence: `src/manager/plan.rs`)
- Terminal manager → Transport checker: runs checks (evidence: `src/manager/mod.rs`)
- Terminal manager → Config and tunnel store: manages saved tunnels (evidence: `src/manager/mod.rs`)
- Terminal manager → Managed services: starts services (evidence: `src/manager/mod.rs`)
- Browser operator → Dashboard interface: manages servers (evidence: `README.md`)
- Dashboard interface → Dashboard API client: requests dashboard data (evidence: `dashboard-ui/src/App.svelte`)
- Dashboard interface → Dashboard authentication: checks session (evidence: `dashboard-ui/src/App.svelte`)
- Dashboard API client → Dashboard server: calls dashboard
- Dashboard server → Dashboard authentication: authenticates requests
- Dashboard server → Dashboard operations: dispatches operations
- Dashboard operations → Config and tunnel store: manages tunnel state
- Peer server → Tunnel engine: connects as tunnel peer (evidence: `README.md`)
- Tunnel engine → Tunnel configuration: loads tunnel settings (evidence: `src/engine.rs`)
- Tunnel engine → Transport security: opens secure connections (evidence: `src/engine.rs`)
- Tunnel engine → Carrier transports: uses carriers (evidence: `src/engine.rs`)
- Tunnel engine → Tunnel statistics: reports traffic (evidence: `src/engine.rs`)
- Tunnel engine → Gaming UDP channels: supports gaming channels (evidence: `src/engine.rs`)
- Tunnel engine → Destination service or network: forwards traffic (evidence: `README.md`)
- Tunnel configuration → Tunnel key and identity: uses tunnel identity (evidence: `src/config.rs`)
- Tunnel configuration → Stealth options: configures stealth (evidence: `src/config.rs`)
- Terminal manager → Parallax transport: offers transport options
- Tunnel configuration → Parallax transport: configures carrier (evidence: `src/config.rs`)
- Tunnel configuration → Raw packet transport: configures raw carrier (evidence: `src/config.rs`)
- Tunnel configuration → Source spoofing: configures spoofing (evidence: `src/config.rs`)
- Source spoofing → Raw packet transport: uses raw packets (evidence: `src/raw_packet.rs`)
- Terminal manager → Spoof sessions: sets up Mirage
- Transport checker → Tunnel planning: uses tunnel plans (evidence: `src/checker/mod.rs`)
