| Crates.io | wireguard-conf |
| lib.rs | wireguard-conf |
| version | 0.3.0 |
| created_at | 2025-02-15 08:29:16.92929+00 |
| updated_at | 2025-05-20 15:07:45.293698+00 |
| description | Construct Wireguard's interface and peer configs |
| homepage | https://github.com/idkncc/wireguard-conf |
| repository | https://github.com/idkncc/wireguard-conf |
| max_upload_size | |
| id | 1556610 |
| size | 48,692 |
Easy to use library for creating wireguard configs.
Install wireguard-conf and ipnet (for parsing ip networks)
cargo add wireguard-conf ipnet
More usage examples in tests and on docs.rs
use wireguard_conf::prelude::*;
use wireguard_conf::as_ipnet;
use ipnet::Ipv4Net;
// create peer:
let peer = PeerBuilder::new()
.add_allowed_ip(as_ipnet!("10.0.0.2/24"))
.build();
// create interface with that peer:
let interface = InterfaceBuilder::new()
.address(as_ipnet!("10.0.0.1/24"))
.add_peer(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).unwrap());
amneziawg: adds support for generating/using AmneziaWG obfuscation values.cargo fmt
cargo clippy
git commit -m "feat: did something"