Function tcp_tunnel

Source
pub async fn tcp_tunnel<D, U>(
    stream: D,
    upstream: U,
) -> Result<(u64, u64), Error>
where U: AsyncRead + AsyncWrite + Unpin + Send + 'static, D: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Expand description

Creates a tunnel between the given [Stream] and [TcpStream].

On success, the total number of bytes sent and received is returned.