Clarify raw TCP compatibility helpers

Co-authored-by: Maxim Myalin <maxim@myalin.ru>
This commit is contained in:
Cursor Agent 2026-03-22 12:52:15 +00:00
parent 38b11b085d
commit fddd12d50d
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -220,12 +220,12 @@ impl UpstreamStream {
} }
} }
#[allow(dead_code)]
pub fn into_tcp(self) -> Result<TcpStream> { pub fn into_tcp(self) -> Result<TcpStream> {
match self { match self {
Self::Tcp(stream) => Ok(stream), Self::Tcp(stream) => Ok(stream),
Self::Shadowsocks(_) => Err(ProxyError::Config( Self::Shadowsocks(_) => Err(ProxyError::Config(
"shadowsocks upstreams are not supported when general.use_middle_proxy = true" "selected upstream does not expose a raw TCP stream".to_string(),
.to_string(),
)), )),
} }
} }
@ -810,6 +810,7 @@ impl UpstreamManager {
} }
/// Connect to target through a selected upstream and return egress details. /// Connect to target through a selected upstream and return egress details.
#[allow(dead_code)]
pub async fn connect_with_details( pub async fn connect_with_details(
&self, &self,
target: SocketAddr, target: SocketAddr,