# haonixao/umbrella-protocol architecture

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

- Interactive diagram: https://gitdiagram.com/haonixao/umbrella-protocol
- Repository: https://github.com/haonixao/umbrella-protocol

## Overview

Umbrella Protocol combines a Fyne client with a configurable server and three traffic transports: Hysteria, Torrent Stealth, and XHTTP. The user workflow is to configure and start a client tunnel, which routes traffic through a selected server mode; activation is a separate Gmail-based control plane. The graph preserves the documented shaper, decoy, UI settings, and tunnel-tool capabilities. Some client wiring and unsampled subsystems are shown only where documented; those links are dashed when source evidence was not provided.

Main entry points: [`umbrella_client/internal/app/app.go`](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/app/app.go) (Client controls), [`umbrella_server/cmd/server/main.go`](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/cmd/server/main.go) (Server protocol dispatcher), [`umbrella_client/internal/windows/settings.go`](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/windows/settings.go) (Settings window), [`umbrella_client/internal/client/hysteria/main.go`](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/hysteria/main.go) (Hysteria client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_ui_entry["UI entry<br/>[main.go]"]
  node_client_app["Client controls<br/>[app.go]"]
  node_client_settings["Client settings<br/>[settings.go]"]
  node_settings_window["Settings window<br/>[settings.go]"]
  node_config["Client configuration<br/>[config.go]"]
  node_storage[("Config and phases storage<br/>[storage.go]")]
  node_tunnel_tools["External tunnel tools<br/>[tunnel.go]"]
end

subgraph group_control["Activation control plane"]
  node_gmail_client["Gmail IMAP client<br/>[imap.go]"]
  node_activator["IP activator<br/>[activator.go]"]
  node_key_manager[("Activation keys<br/>[manager.go]")]
end

subgraph group_transports["Traffic transports"]
  node_hysteria_client["Hysteria client<br/>[main.go]"]
  node_torrent_client["Torrent client<br/>[main.go]"]
  node_xhttp_client["XHTTP client<br/>[main.go]"]
end

subgraph group_server["Server runtime"]
  node_server_config["Server configuration<br/>[config.go]"]
  node_server_entry["Server protocol dispatcher<br/>[main.go]"]
  node_hysteria_server["Hysteria server<br/>[hysteria.go]"]
  node_torrent_server["Torrent server<br/>[torrent.go]"]
  node_xhttp_server["XHTTP server<br/>[xhttp.go]"]
end

subgraph group_support["Protection and settings"]
  node_shaper["Traffic shaper<br/>[shaper.go]"]
  node_decoy["Decoy traffic<br/>[decoy.go]"]
  node_themes["UI themes<br/>[theme.go]"]
end

node_user(("User"))
node_gmail(("Gmail IMAP"))
node_destinations(("Internet destinations"))

node_user -->|"starts"| node_ui_entry
node_ui_entry -->|"runs"| node_client_app
node_user -.->|"controls"| node_client_app
node_client_app -.->|"uses"| node_client_settings
node_settings_window -.->|"edits"| node_config
node_settings_window -.->|"persists"| node_storage
node_settings_window -.->|"configures"| node_tunnel_tools
node_client_app -.->|"starts mode"| node_hysteria_client
node_client_app -.->|"starts mode"| node_torrent_client
node_client_app -.->|"starts mode"| node_xhttp_client
node_client_app -.->|"uses theme"| node_themes
node_client_app -.->|"runs decoys"| node_decoy
node_hysteria_client -.->|"shapes traffic"| node_shaper
node_torrent_client -.->|"shapes traffic"| node_shaper
node_xhttp_client -.->|"shapes traffic"| node_shaper
node_gmail_client -->|"uses IMAP"| node_gmail
node_gmail_client -.->|"exchanges activation"| node_activator
node_activator -.->|"checks IP"| node_key_manager
node_server_entry -->|"loads"| node_server_config
node_server_entry -->|"dispatches"| node_hysteria_server
node_server_entry -->|"dispatches"| node_torrent_server
node_server_entry -->|"dispatches"| node_xhttp_server
node_hysteria_client -.->|"routes traffic"| node_hysteria_server
node_torrent_client -.->|"routes traffic"| node_torrent_server
node_xhttp_client -.->|"routes traffic"| node_xhttp_server
node_hysteria_server -.->|"forwards traffic"| node_destinations
node_torrent_server -.->|"forwards traffic"| node_destinations
node_xhttp_server -.->|"forwards traffic"| node_destinations

click node_ui_entry "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/cmd/ui/main.go"
click node_client_app "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/app/app.go"
click node_client_settings "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/settings/settings.go"
click node_settings_window "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/windows/settings.go"
click node_config "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/config/config.go"
click node_storage "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/storage/storage.go"
click node_tunnel_tools "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/tunnel/tunnel.go"
click node_gmail_client "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/pkg/imap/gmail/imap.go"
click node_activator "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/activator/activator.go"
click node_key_manager "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/pkg/umanager/manager.go"
click node_server_config "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/config/config.go"
click node_server_entry "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/cmd/server/main.go"
click node_hysteria_client "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/hysteria/main.go"
click node_torrent_client "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/torrent/main.go"
click node_xhttp_client "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/xhttp/main.go"
click node_hysteria_server "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/hysteria/hysteria.go"
click node_torrent_server "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/torrent/torrent.go"
click node_xhttp_server "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/xhttp/xhttp.go"
click node_shaper "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/shaper/shaper.go"
click node_decoy "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/decoy/decoy.go"
click node_themes "https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/ui/theme.go"

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_ui_entry,node_client_app,node_client_settings,node_settings_window,node_config,node_storage,node_tunnel_tools,node_user toneBlue
class node_gmail_client,node_activator,node_key_manager toneAmber
class node_hysteria_client,node_torrent_client,node_xhttp_client toneMint
class node_server_config,node_server_entry,node_hysteria_server,node_torrent_server,node_xhttp_server toneRose
class node_shaper,node_decoy,node_themes,node_gmail,node_destinations toneIndigo
```

## Components

### Client application

- [UI entry](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/cmd/ui/main.go): `umbrella_client/cmd/ui/main.go`
- [Client controls](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/app/app.go): `umbrella_client/internal/app/app.go`
- [Client settings](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/settings/settings.go): `umbrella_client/internal/settings/settings.go`
- [Settings window](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/windows/settings.go): `umbrella_client/internal/windows/settings.go`
- [Client configuration](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/config/config.go): `umbrella_client/internal/client/config/config.go`
- [Config and phases storage](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/storage/storage.go): `umbrella_client/internal/storage/storage.go`
- [External tunnel tools](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/tunnel/tunnel.go): `umbrella_client/internal/tunnel/tunnel.go`

### Activation control plane

- [Gmail IMAP client](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/pkg/imap/gmail/imap.go): `umbrella_client/pkg/imap/gmail/imap.go`
- [IP activator](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/activator/activator.go): `umbrella_server/internal/activator/activator.go`
- [Activation keys](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/pkg/umanager/manager.go): `umbrella_server/pkg/umanager/manager.go`

### Traffic transports

- [Hysteria client](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/hysteria/main.go): `umbrella_client/internal/client/hysteria/main.go`
- [Torrent client](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/torrent/main.go): `umbrella_client/internal/client/torrent/main.go`
- [XHTTP client](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/xhttp/main.go): `umbrella_client/internal/client/xhttp/main.go`

### Server runtime

- [Server configuration](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/config/config.go): `umbrella_server/internal/config/config.go`
- [Server protocol dispatcher](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/cmd/server/main.go): `umbrella_server/cmd/server/main.go`
- [Hysteria server](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/hysteria/hysteria.go): `umbrella_server/internal/hysteria/hysteria.go`
- [Torrent server](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/torrent/torrent.go): `umbrella_server/internal/torrent/torrent.go`
- [XHTTP server](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_server/internal/xhttp/xhttp.go): `umbrella_server/internal/xhttp/xhttp.go`

### Protection and settings

- [Traffic shaper](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/shaper/shaper.go): `umbrella_client/internal/client/shaper/shaper.go`
- [Decoy traffic](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/client/decoy/decoy.go): `umbrella_client/internal/client/decoy/decoy.go`
- [UI themes](https://github.com/haonixao/umbrella-protocol/blob/main/umbrella_client/internal/ui/theme.go): `umbrella_client/internal/ui/theme.go`

### Other components

- **User**
- **Gmail IMAP**
- **Internet destinations**

## Connections

- User → UI entry: starts (evidence: `umbrella_client/cmd/ui/main.go`)
- UI entry → Client controls: runs (evidence: `umbrella_client/cmd/ui/main.go`)
- User → Client controls: controls
- Client controls → Client settings: uses
- Settings window → Client configuration: edits
- Settings window → Config and phases storage: persists
- Settings window → External tunnel tools: configures
- Client controls → Hysteria client: starts mode
- Client controls → Torrent client: starts mode
- Client controls → XHTTP client: starts mode
- Client controls → UI themes: uses theme
- Client controls → Decoy traffic: runs decoys
- Hysteria client → Traffic shaper: shapes traffic
- Torrent client → Traffic shaper: shapes traffic
- XHTTP client → Traffic shaper: shapes traffic
- Gmail IMAP client → Gmail IMAP: uses IMAP (evidence: `umbrella_client/pkg/imap/gmail/imap.go`)
- Gmail IMAP client → IP activator: exchanges activation (evidence: `README.md`)
- IP activator → Activation keys: checks IP
- Server protocol dispatcher → Server configuration: loads (evidence: `umbrella_server/cmd/server/main.go`)
- Server protocol dispatcher → Hysteria server: dispatches (evidence: `umbrella_server/cmd/server/main.go`)
- Server protocol dispatcher → Torrent server: dispatches (evidence: `umbrella_server/cmd/server/main.go`)
- Server protocol dispatcher → XHTTP server: dispatches (evidence: `umbrella_server/cmd/server/main.go`)
- Hysteria client → Hysteria server: routes traffic (evidence: `README.md`)
- Torrent client → Torrent server: routes traffic (evidence: `README.md`)
- XHTTP client → XHTTP server: routes traffic (evidence: `README.md`)
- Hysteria server → Internet destinations: forwards traffic (evidence: `README.md`)
- Torrent server → Internet destinations: forwards traffic (evidence: `README.md`)
- XHTTP server → Internet destinations: forwards traffic (evidence: `README.md`)
