この紹介文は現在英語版のみです。
BoringTun
BoringTun is a high-performance, userspace implementation of the WireGuard® protocol written in Rust. It’s designed for portability and speed, making it an ideal choice for various platforms including iOS, Android, and Linux servers.
Core Features
- High Performance: Optimized Rust implementation for maximum speed
- Cross-Platform: Supports multiple architectures and operating systems
- Security Focused: Implements the WireGuard protocol with security in mind
- Userspace Implementation: Runs entirely in userspace for better portability
- Minimal Dependencies: Lightweight and easy to deploy
- FFI Support: Provides C ABI bindings for integration with other languages
- JNI Bindings: Java Native Interface support for Android integration
Supported Platforms
| Platform | Architecture | Binary | Library |
|---|---|---|---|
| Linux | x86_64 | ✓ | ✓ |
| Linux | aarch64 | ✓ | ✓ |
| Linux | armv7 | ✓ | ✓ |
| macOS | x86_64 | ✓ | ✓ |
| Windows | x86_64 | ✓ | - |
| iOS | aarch64 | ✓ | - |
| iOS | armv7 | ✓ | - |
| Android | aarch64 | ✓ | - |
| Android | arm | ✓ | - |
Quick Start
-
Installation:
cargo install boringtun-cli -
Building:
# Library only cargo build --lib --no-default-features --release # Executable cargo build --bin boringtun-cli --release -
Running:
# Basic usage boringtun-cli [-f/--foreground] INTERFACE-NAME # With wg-quick sudo WG_QUICK_USERSPACE_IMPLEMENTATION=boringtun-cli WG_SUDO=1 wg-quick up CONFIGURATION
Development
-
Requirements:
- Rust toolchain
- sudo (for testing)
- Docker (for testing)
-
Testing:
cargo test -
Contributing:
- Fork the repository
- Create a feature branch
- Submit a pull request
- Follow the contribution guidelines
Integration
-
C/C++ Integration:
#include "wireguard_ffi.h" // Use the C ABI bindings -
Swift Integration:
// Use bridging header with C bindings -
C# Integration:
[DllImport("boringtun", CallingConvention = CallingConvention.Cdecl)] // Use DLLImport
Security Considerations
- Privilege Dropping: Drops privileges when started
- CAP_NET_ADMIN: Requires capability for network operations
- Fwmark Support: Optional fwmark setting with proper privileges
- Interface Naming: Follows platform-specific conventions
Community
- Issues: Report bugs and request features on GitHub
- Contributions: Pull requests are welcome
- Documentation: Detailed documentation available
- Support: Community support through GitHub
License
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
WireGuard is a registered trademark of Jason A. Donenfeld. BoringTun is not sponsored or endorsed by Jason A. Donenfeld.