| Crates.io | wireguard-conf |
| lib.rs | wireguard-conf |
| version | 1.0.1 |
| created_at | 2025-02-15 08:29:16.92929+00 |
| updated_at | 2025-11-23 16:30:24.915332+00 |
| description | Generate Wireguard configs and interfaces with code |
| homepage | https://github.com/idkncc/wireguard-conf |
| repository | https://github.com/idkncc/wireguard-conf |
| max_upload_size | |
| id | 1556610 |
| size | 72,475 |
Easy to use library for creating wireguard configs.
Install wireguard-conf
cargo add wireguard-conf
The best way to understand library: Quickstart!
More usage examples you can find in tests/tutorial.rs, tests folder and documentation examples on docs.rs.
use wireguard_conf::prelude::*;
use wireguard_conf::as_ipnet;
let peer = Peer::builder()
.allowed_ips([as_ipnet!("10.0.0.2/24")])
.build();
let interface = Interface::builder()
.address([as_ipnet!("10.0.0.1/24")])
.peers([peer.clone()])
.build();
// to export configs, use `println!()`, `writeln!()`, `.to_string()`, etc.
println!("Server's config:");
println!("{}\n", interface);
println!("Client's config:");
println!("{}", peer.to_interface(&interface, ToInterfaceOptions::new()).unwrap());
amneziawg: adds support for generating/using AmneziaWG obfuscation values.serde: adds implementions of [serde::Serialize] and [serde::Deserialize] for all structs.Fork & clone
Install Rust, Cargo and just.
Or start nix shell: direnv allow or just nix develop
Make changes
Format and lint code:
just fmt
just lint
# or fix automatically: just lint-fix
Commit changes (use Conventional commits)
git commit -m "feat: did something"
Send patches PR