Changes to be committed:

modified:   .gitignore
	modified:   src/client.rs
	modified:   src/server.rs
This commit is contained in:
Michael Wain 2024-08-10 21:34:13 +03:00
parent edb9e01dd7
commit d89cce67b0
3 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,11 @@ pub async fn client_mode(remote_addr: &str) -> io::Result<()> {
config.destination("0.0.0.0"); config.destination("0.0.0.0");
config.name("tun0"); config.name("tun0");
#[cfg(target_os = "linux")]
config.platform(|config| {
config.packet_information(true);
});
let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap())); let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap()));
let sock = Arc::new(Mutex::new(UdpSocket::bind("0.0.0.0:59611").await?)); let sock = Arc::new(Mutex::new(UdpSocket::bind("0.0.0.0:59611").await?));

View File

@ -17,6 +17,11 @@ pub async fn server_mode() -> io::Result<()> {
config.address("10.8.0.1"); config.address("10.8.0.1");
config.name("tun0"); config.name("tun0");
#[cfg(target_os = "linux")]
config.platform(|config| {
config.packet_information(true);
});
let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap())); let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap()));
let sock = Arc::new(Mutex::new(UdpSocket::bind("192.168.0.5:8879".parse::<SocketAddr>().unwrap()).await?)); let sock = Arc::new(Mutex::new(UdpSocket::bind("192.168.0.5:8879".parse::<SocketAddr>().unwrap()).await?));