Skip to content

Commit

Permalink
feat(shadowsocks): ProxyServerStream::from_stream made public (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Aug 13, 2024
1 parent 0041f62 commit d67908f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 9 additions & 1 deletion crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ pub struct ProxyServerStream<S> {
}

impl<S> ProxyServerStream<S> {
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<S> {
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,
Expand Down

0 comments on commit d67908f

Please sign in to comment.