{"id":73085,"library":"tokio-tun","title":"tokio-tun","description":"Asynchronous allocation and management of TUN/TAP devices using the Tokio runtime.","status":"active","version":"0.15.2","language":"rust","source_language":null,"source_url":"https://github.com/yaa110/tokio-tun","tags":["tun","tap","network","async","tokio","vpn"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ntokio-tun = \"0.15.2\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add tokio-tun","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Tun","correct":"use tokio_tun::Tun;"}],"quickstart":{"code":"use tokio_tun::Tun;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let mut tun = Tun::new(\"tun0\", 1500).await?;\n    let mut buf = vec![0u8; 1500];\n    let n = tun.recv(&mut buf).await?;\n    println!(\"Received {} bytes\", n);\n    Ok(())\n}","lang":"rust","description":"Creates a TUN device and reads a packet asynchronously."},"warnings":[{"fix":"Run the binary with sudo or appropriate capabilities.","message":"Requires root/administrator privileges to create TUN/TAP devices.","severity":"gotcha","affected_versions":">=0.15.0"},{"fix":"Use conditional compilation or alternative for Windows.","message":"Only works on Unix-like systems (Linux, macOS, BSD).","severity":"breaking","affected_versions":">=0.15.0"}],"env_vars":null,"search_vec":"'alloc':5 'async':18 'asynchron':4 'devic':10 'manag':7 'network':17 'runtim':14 'tap':16 'tokio':2,13,19 'tokio-tun':1 'tun':3,15 'tun/tap':9 'use':11 'vpn':20","created_at":"2026-06-17T18:47:18.560320+00:00","updated_at":"2026-06-17T18:47:18.560320+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/yaa110/tokio-tun","github":"https://github.com/yaa110/tokio-tun","docs":"https://docs.rs/tokio-tun/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking","async"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}