Initial commit: Project structure, Coordinator Server v1.0.0, and Documentation

This commit is contained in:
Claude Code committed 2026-09-30 21:27:02 -04:00
commit 0ead98d0c4
18 files changed
+2073

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
# MeshVPN Client
The MeshVPN Client creates a secure, peer-to-peer overlay network on your machine. It uses WireGuard encryption and UDP hole punching to connect you to other peers without needing manual port forwarding.
## Features
- **Zero-Config Connection**: Connect using a simple Network Key.
- **Cross-Platform**: Supports Windows, macOS, and Linux.
- **Secure E2EE**: End-to-end encryption powered by the Noise Protocol.
- **Automatic NAT Traversal**: Bypasses firewalls using STUN and UDP hole punching.
## Installation
### Prerequisites
- [Rust](https://rustup.rs/) (Stable channel)
- **Administrator/Root Privileges**: Required to create the virtual TUN interface.
### Setup
1. **Clone the repository**
2. **Build the client**:
```bash
cargo build --release
```
3. **Install TUN Driver**:
- **Windows**: Install `Wintun` (bundled with the installer).
- **macOS**: Grant permissions for the Network Extension.
- **Linux**: Ensure the `tun` module is loaded (`modprobe tun`).
## Usage
1. **Start the Client**:
```bash
./target/release/meshvpn-client
```
2. **Configure Your Node**:
- **Network Key**: Enter the shared key provided by your network administrator.
- **User Name**: Enter your preferred display name (e.g., "My-Laptop").
3. **Connect**:
The client will automatically discover the coordinator, register your node, and start discovering peers.
## Troubleshooting
- **Permission Denied**: Ensure you are running the client as Administrator (Windows) or using `sudo` (Linux/macOS).
- **Cannot Connect**: Check if UDP port 3478 (STUN) and 50051 (Coordinator) are reachable from your network.
+38
View File
@@ -0,0 +1,38 @@
# Windows Deployment Guide (.exe)
To ensure the client is a lightweight `.exe` that consumes less than 256MB of RAM, follow these build instructions.
## 🛠 Build Process
1. **Environment Setup**:
- Install [Rust](https://rustup.rs/).
- Install [LLVM](https://llvm.org/build/) (required for some networking crates).
2. **Optimization Flags**:
To keep the binary small and memory usage low, use the following `Cargo.toml` profile:
```toml
[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Link Time Optimization
codegen-units = 1 # Maximize optimization
panic = 'abort' # Remove stack unwinding (saves space/RAM)
strip = true # Remove symbols from the binary
```
3. **Building the .exe**:
```bash
cargo build --release
```
The resulting executable will be in `target/release/meshvpn-client.exe`.
## 📦 Resource Constraints (< 256MB RAM)
To guarantee low memory usage:
- **Asynchronous Runtime**: Using `tokio` with the `current_thread` scheduler instead of `multi_thread` to reduce thread overhead.
- **Zero-Copy**: Using `bytes` crate for packet handling to avoid unnecessary memory allocations.
- **No GUI**: By keeping it a CLI tool, we avoid the massive overhead of Electron or similar frameworks.
## 🚦 Administrator Requirements
The `.exe` must be run as **Administrator** to:
1. Load the `wintun.dll`.
2. Create the virtual network adapter.
3. Set routing table entries.