diff --git a/crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs b/crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs index 2c1c7764c88d..055393c27ae3 100644 --- a/crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs +++ b/crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs @@ -78,7 +78,7 @@ impl ProxyListener { let stream = map_fn(stream); // Create a ProxyServerStream and read the target address from it - let stream = ProxyServerStream::from_stream( + let stream = ProxyServerStream::from_stream_with_user_manager( self.context.clone(), stream, self.method, diff --git a/crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs b/crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs index a2005bdac60a..374d9d3ce468 100644 --- a/crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs +++ b/crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs @@ -42,7 +42,15 @@ pub struct ProxyServerStream { } impl ProxyServerStream { - pub(crate) fn from_stream( + /// Create a `ProxyServerStream` from a connection stream + pub fn from_stream(context: SharedContext, stream: S, method: CipherKind, key: &[u8]) -> ProxyServerStream { + ProxyServerStream::from_stream_with_user_manager(context, stream, method, key, None) + } + + /// Create a `ProxyServerStream` from a connection stream + /// + /// Set `user_manager` to enable support of verifying EIH users. + pub fn from_stream_with_user_manager( context: SharedContext, stream: S, method: CipherKind,