Commit 3d623f5a authored by eta's avatar eta
Browse files

Merge branch 'tcp-hook-new-tls' into 'main'

use runtime TlsProvider in tcp-hook example

See merge request !356
parents d549844c f633276a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ use tokio_crate as tokio;
use tor_rtcompat::tokio::TokioNativeTlsRuntime;

use futures::{AsyncRead, AsyncWrite, FutureExt, Stream};
use tor_rtcompat::tls::NativeTlsProvider;
use tor_rtcompat::{CompoundRuntime, TcpListener, TcpProvider};

use futures::io::{AsyncReadExt, AsyncWriteExt};
@@ -31,7 +30,7 @@ async fn main() -> Result<()> {
    // Instantiate our custom TCP provider (see implementation below).
    let tcp_rt = CustomTcpProvider { inner: rt.clone() };
    // Create a `CompoundRuntime`, swapping out the TCP part of the runtime for our custom one.
    let rt = CompoundRuntime::new(rt.clone(), rt, tcp_rt, NativeTlsProvider::default());
    let rt = CompoundRuntime::new(rt.clone(), rt.clone(), tcp_rt, rt);

    eprintln!("connecting to Tor...");
    let tor_client = TorClient::create_bootstrapped(rt, config).await?;