tun2proxy / rust-tun

TUN device creation and handling.
https://docs.rs/tun2/
30 stars 13 forks source link

Win7 error #58

Closed enp6 closed 2 months ago

enp6 commented 3 months ago
thread 'main' panicked at src\main.rs:17:41:
called `Result::unwrap()` on an `Err` value: WintunError(String("Unable to find
matching {7C276CB3-823B-4AD3-816C-1D3EA30E7297}"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I am using the example you provided

let mut config = tun2::Configuration::default();
config
    .address((10, 0, 0, 9))
    .netmask((255, 255, 255, 0))
    .destination((10, 0, 0, 1))
    .up();

#[cfg(target_os = "linux")]
config.platform_config(|config| {
    // requiring root privilege to acquire complete functions
    config.ensure_root_privileges(true);
});

let mut dev = tun2::create(&config).unwrap();
let mut buf = [0; 4096];

loop {
    let amount = dev.read(&mut buf).unwrap();
    println!("{:?}", &buf[0..amount]);
}
ssrlive commented 2 months ago

No error. image