pub async fn accept_map<F, S>(&self, map_fn: F) -> io::Result<(ProxyServerStream<S>, SocketAddr)>
    where
        F: FnOnce(TcpStream) -> S,
        S: AsyncRead + AsyncWrite + Unpin,
    {
        let (stream, peer_addr) = self.listener.accept().await?;
        let stream = map_fn(stream);

        // Create a ProxyServerStream and read the target address from it
        let stream = ProxyServerStream::from_stream_with_user_manager(
            self.context.clone(),
            stream,
            self.method,
            &self.key,
            self.user_manager.clone(),
        );

        Ok((stream, peer_addr))
    }
Accepts a shadowsocks' client connection and maps the accepted `TcpStream` to another stream type
crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs