https://github.com/zarvd/wiretun
WireGuard implementation in Rust with Tokio
https://github.com/zarvd/wiretun
rust tokio wireguard
Last synced: 2 months ago
JSON representation
WireGuard implementation in Rust with Tokio
- Host: GitHub
- URL: https://github.com/zarvd/wiretun
- Owner: zarvd
- License: apache-2.0
- Created: 2023-03-21T11:03:25.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T01:38:39.000Z (over 1 year ago)
- Last Synced: 2025-07-05T05:51:30.231Z (3 months ago)
- Topics: rust, tokio, wireguard
- Language: Rust
- Homepage:
- Size: 304 KB
- Stars: 50
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WireTun
[
](https://github.com/zarvd/wiretun)
[](https://crates.io/crates/wiretun)
[](https://docs.rs/wiretun)
[](https://github.com/zarvd/wiretun/actions?query%3Amaster)
[](https://deps.rs/repo/github/zarvd/wiretun)
This library provides a cross-platform, asynchronous (with [Tokio](https://tokio.rs/)) [WireGuard](https://www.wireguard.com/) implementation.
**WARNING**: This library is still in early development and is not ready for production use.
```toml
[dependencies]
wiretun = { version = "*", features = ["uapi"] }
```## Example
```rust
use wiretun::{Cidr, Device, DeviceConfig, PeerConfig, uapi};#[tokio::main]
async fn main() -> Result<(), Box> {
let cfg = DeviceConfig::default()
.listen_port(40001);
let device = Device::native("utun88", cfg).await?;
uapi::bind_and_handle(device.control()).await?;
Ok(())
}
```More examples can be found in the [examples](examples) directory.
## Minimum supported Rust version (MSRV)
1.66.1
## License
This project is licensed under the [Apache 2.0 license](LICENSE).