mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
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:
@@ -555,6 +555,15 @@ struct NetworkOptions {
|
||||
default_missing_value = "true"
|
||||
)]
|
||||
enable_relay_foreign_network_kcp: Option<bool>,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
env = "ET_STUN_SERVERS",
|
||||
value_delimiter = ',',
|
||||
help = t!("core_clap.stun_servers").to_string(),
|
||||
num_args = 0..
|
||||
)]
|
||||
stun_servers: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -924,6 +933,10 @@ impl NetworkOptions {
|
||||
old_udp_whitelist.extend(self.udp_whitelist.clone());
|
||||
cfg.set_udp_whitelist(old_udp_whitelist);
|
||||
|
||||
if let Some(stun_servers) = &self.stun_servers {
|
||||
cfg.set_stun_servers(stun_servers.clone());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user