optimize the condition of enabling kcp (#1210)

This commit is contained in:
Sijie.Sun
2025-08-09 16:16:09 +08:00
committed by GitHub
parent 37b24164b6
commit 8ffc2f12e4
11 changed files with 110 additions and 18 deletions
@@ -163,6 +163,10 @@ impl ForeignNetworkEntry {
config.set_network_identity(network.clone());
config.set_hostname(Some(format!("PublicServer_{}", global_ctx.get_hostname())));
let mut flags = config.get_flags();
flags.disable_relay_kcp = !global_ctx.get_flags().enable_relay_foreign_network_kcp;
config.set_flags(flags);
let foreign_global_ctx = Arc::new(GlobalCtx::new(config));
foreign_global_ctx
.replace_stun_info_collector(Box::new(global_ctx.get_stun_info_collector().clone()));