feat: autonomous self-downloading dependencies inside TUN OS drivers

This commit is contained in:
ospab 2026-05-15 15:58:35 +03:00
parent 22fb9bb3d3
commit da50d2f15f
2 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,9 @@ pub async fn run_linux_tunnel(
println!("[ostp-client] Starting Linux TUN handler initialization...");
}
// 1. Locate tun2socks binary
// 1. Automatically ensure tun2socks binary is downloaded and present
super::download_tun2socks(debug)?;
let exe = std::env::current_exe()?;
let dir = exe.parent().ok_or_else(|| anyhow!("failed to get binary directory"))?;

View File

@ -15,13 +15,16 @@ pub async fn run_wintun_tunnel(
println!("[ostp-client] Initializing high-performance TUN tunnel via tun2socks...");
}
// 1. Get executable directory to locate tun2socks.exe and wintun.dll
// 1. Automatically ensure Wintun and tun2socks dependencies are downloaded and present
super::download_wintun_dll(debug)?;
super::download_tun2socks(debug)?;
let exe = std::env::current_exe()?;
let dir = exe.parent().ok_or_else(|| anyhow!("failed to get binary directory"))?;
let tun2socks_exe = dir.join("tun2socks.exe");
if !tun2socks_exe.exists() {
return Err(anyhow!("tun2socks.exe not found! Please ensure initialization downloaded it successfully."));
return Err(anyhow!("tun2socks.exe not found! Even after download attempt, binary remains missing."));
}
// 2. Resolve Server IP for routing table exclusion