1.4 KiB
1.4 KiB
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
-
Environment Setup:
-
Optimization Flags: To keep the binary small and memory usage low, use the following
Cargo.tomlprofile:[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 -
Building the .exe:
cargo build --releaseThe resulting executable will be in
target/release/meshvpn-client.exe.
📦 Resource Constraints (< 256MB RAM)
To guarantee low memory usage:
- Asynchronous Runtime: Using
tokiowith thecurrent_threadscheduler instead ofmulti_threadto reduce thread overhead. - Zero-Copy: Using
bytescrate 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:
- Load the
wintun.dll. - Create the virtual network adapter.
- Set routing table entries.