tun init logic seperation by platforms

This commit is contained in:
2026-03-13 14:36:55 +07:00
parent d4ffb90152
commit 66036c1451
8 changed files with 47 additions and 16 deletions
+9
View File
@@ -0,0 +1,9 @@
use crate::tun::tun::Tun; // Убедись, что путь к Tun верный
use std::io;
pub fn setup_platform_routing(tun_device: &Tun, remote_address: &str) -> io::Result<()> {
let proxy_ip = remote_address.split(':').next().unwrap_or(remote_address);
tun_device.setup_routing(proxy_ip)?;
tun_device.setup_dns_redirection()?;
Ok(())
}