How notnonex/easytier works
Project’s main components
• Core VPN Node (easytier): This is the heart of the application that handles network connections, peer management, tunneling, routing (NAT traversal, UDP/TCP switching), and service discovery. Look at directories like src/arch, src/connector, src/peer_center, src/tunnel, and src/gateway.
• Command-line Interface (CLI): Commands provided by easytier-cli to inspect nodes, routes, and peers.
• GUI Client (easytier-gui): A Tauri-based GUI that wraps the Rust backend and includes a modern web frontend (Vue or similar). It includes both a JavaScript/TypeScript codebase and a “src-tauri” folder that connects to the main Rust code.
• Web Management Interface (easytier-web): Contains two parts—a “frontend-lib” (providing a reusable component library) and a “frontend” directory for the actual application UI. Also, there is backend logic integrated within the Rust code (in src/ of easytier-web) that handles API requests, session management, and database interactions.
• RPC & Plugin Components: The “easytier-rpc-build” module shows the generation of RPC interfaces used in inter-node communication, while “tauri-plugin-vpnservice” represents an external plugin to extend VPN functionalities, with its own mobile-specific implementations.
• External Communication Interfaces: The README details integration with WireGuard (tunnel configuration via the vpn-portal option), connection with public server clusters, and support for external networking without public IP using shared nodes.
Components in layers and highlight their interactions
▪ The Networking Engine (implemented in Rust): Modules for connectors, NAT traversal (UDP hole punching), encryption (WireGuard integration, AES-GCM in peers/encrypt), and tunnel/packet processing.
▪ The Database and Configuration Management: Shown in the “easytier” module under src/common/config and src/db for persistent configuration, routing, and state management.
• Then, include the API/Interface Layer:
▪ Command-line Interface (CLI) interacting with the core for diagnostics.
▪ RPC interfaces that allow inter-node communication, details of which are generated by the easytier-rpc-build module.
• At the application layer, place:
▪ The GUI Client (Tauri-based) that packages frontend (Vue/JS code from easytier-gui/src) with its Rust backend set up in “easytier-gui/src-tauri”.
▪ The Web Management Interface (front end and backend components from the easytier-web folder). This part can be diagrammed as an independent subsystem interfacing with the core node.
▪ The Mobile VPN Plugin (tauri-plugin-vpnservice), with connections to the core, providing mobile service integration.
• Finally, denote external interactions:
▪ WireGuard Client Connection (illustrating how a mobile client uses the WireGuard configuration provided by easytier-cli).
▪ Public Shared Node Servers that allow nodes behind NAT and without public IP to connect.
▪ Integration with external services (like updates via GitHub actions, build scripts, etc.).
Architectural patterns and design principles
• Modularity: Each major feature (core networking, GUI, web management, plugins) is kept in separate directories/repositories, which suggests a clear separation of concerns.
• Layered Architecture: The networking engine supports multiple interfaces (CLI, GUI, Web, and plugins) through a well-defined API and RPC mechanism.
• Cross-platform considerations: Special handling for Android and potential iOS support is visible in separate directories.
• Extensibility: The use of plugins (tauri-plugin-vpnservice) and modular design in the project structure hint at a strategy aiming for ease of adding new protocols or features in the future.