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(())
}