Crate wiretun

Source
Expand description

§WireTun

WireTun is a user-space WireGuard implementation in Rust.

§What is WireGuard?

WireGuard is a modern, high-performance VPN protocol that is designed to be simple to use and easy to configure. It is often used to create secure private networks and build reliable, low-latency connections.

§Features

  • Implementation of the WireGuard protocol in Rust.
  • Asynchronous I/O using Tokio.

§Examples

use wiretun::{Cidr, Device, DeviceConfig, PeerConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
   let cfg = DeviceConfig::default()
       .listen_port(40001);
   let device = Device::native("utun88", cfg).await?;
   Ok(())
}

Re-exports§

pub use noise::crypto::LocalStaticSecret;
pub use noise::crypto::PeerStaticSecret;

Modules§

noise

Structs§

Cidr
Cidr represents a CIDR block.
Device
A WireGuard device.
DeviceConfig
Configuration for a device.
DeviceControl
A handle to a device.
Endpoint
NativeTun
Native tun implementation.
PeerConfig
Configuration for a peer.
UdpTransport
UdpTransport is a UDP transport that implements the Transport trait.

Enums§

ParseCidrError
TunError

Traits§

Transport
Transport is a trait that represents a network transport.
Tun