From 41562707ecfcaf409a1ac3165edee8ad7a81663f Mon Sep 17 00:00:00 2001 From: ospab Date: Thu, 21 May 2026 14:54:03 +0300 Subject: [PATCH] fix: UoT uses server port instead of hardcoded 443 when stealth_port not overridden --- ostp-client/src/bridge.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ostp-client/src/bridge.rs b/ostp-client/src/bridge.rs index f352cd7..981c5b1 100644 --- a/ostp-client/src/bridge.rs +++ b/ostp-client/src/bridge.rs @@ -987,8 +987,16 @@ impl Bridge { ) -> Result { let mode = self.transport_mode.to_lowercase(); if mode == "uot" || mode == "tcp" { + // For UoT, use the stealth_port if it's configured and differs from default 443; + // otherwise fall back to the actual server port so the user doesn't need two separate + // port fields for the same destination. + let uot_port = if self.stealth_port != 443 { + self.stealth_port + } else { + port + }; let (tx, rx) = crate::transport::xhttp::connect_xhttp( - target_ip, self.stealth_port, &self.stealth_sni, &self.access_key + target_ip, uot_port, &self.stealth_sni, &self.access_key ).await?; Ok(crate::transport::Transport::Uot { tx, rx }) } else {