完善配置

This commit is contained in:
lubeilin
2023-02-07 21:31:42 +08:00
parent efb7053931
commit 6872ec3618
11 changed files with 242 additions and 72 deletions
+8 -1
View File
@@ -1,6 +1,5 @@
use std::io;
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket};
use std::sync::Arc;
use console::style;
@@ -54,6 +53,7 @@ impl CommandServer {
}
}
}
fn command(cmd: &str, switch: &Switch) -> io::Result<String> {
let mut out_str = String::new();
match cmd {
@@ -129,6 +129,13 @@ fn command(cmd: &str, switch: &Switch) -> io::Result<String> {
let str = format!("Delay of relay server :{}ms\n", style(server_rt).green());
out_str.push_str(&str);
}
if let Some(nat_info) = switch.nat_info() {
let str = format!(
"NAT type :{}",
style(format!("{:?}", nat_info.nat_type)).green()
);
out_str.push_str(&str);
}
}
"help" | "h" => {
let str = format!("Options: \n");