Support custom STUN servers configuration (#1212)

* Support custom STUN servers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
fanyang
2025-08-13 10:35:59 +08:00
committed by GitHub
parent a511abb613
commit 35ff9b82fc
11 changed files with 93 additions and 45 deletions
@@ -39,7 +39,7 @@ impl InterfaceControl {
if matches!(e.kind(), io::ErrorKind::NotFound) {
Ok(()) // 忽略不存在的值
} else {
Err(e.into())
Err(e)
}
}
}
@@ -106,10 +106,7 @@ impl InterfaceControl {
.output()
.expect("failed to execute process");
if !output.status.success() {
return Err(io::Error::new(
io::ErrorKind::Other,
"Failed to flush DNS cache",
));
return Err(io::Error::other("Failed to flush DNS cache"));
}
Ok(())
}
@@ -122,10 +119,7 @@ impl InterfaceControl {
.output()
.expect("failed to execute process");
if !output.status.success() {
return Err(io::Error::new(
io::ErrorKind::Other,
"Failed to register DNS",
));
return Err(io::Error::other("Failed to register DNS"));
}
Ok(())
}
+2 -2
View File
@@ -399,7 +399,7 @@ impl VirtualNic {
Err(e) => {
println!("Failed to add Easytier to firewall allowlist, Subnet proxy and KCP proxy may not work properly. error: {}", e);
println!("You can add firewall rules manually, or use --use-smoltcp to run with user-space TCP/IP stack.");
println!("");
println!();
}
}
@@ -409,7 +409,7 @@ impl VirtualNic {
}
if !dev_name.is_empty() {
config.tun_name(format!("{}", dev_name));
config.tun_name(&dev_name);
} else {
use rand::distributions::Distribution as _;
let c = crate::arch::windows::interface_count()?;