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
+6 -1
View File
@@ -112,7 +112,12 @@ impl GlobalCtx {
let (event_bus, _) = tokio::sync::broadcast::channel(8);
let stun_info_collection = Arc::new(StunInfoCollector::new_with_default_servers());
let stun_servers = config_fs.get_stun_servers();
let stun_info_collection = Arc::new(if stun_servers.is_empty() {
StunInfoCollector::new_with_default_servers()
} else {
StunInfoCollector::new(stun_servers)
});
let enable_exit_node = config_fs.get_flags().enable_exit_node || cfg!(target_env = "ohos");
let proxy_forward_by_system = config_fs.get_flags().proxy_forward_by_system;