From 1d9c8533adfbd34db8586b12f772a1360e0e111c Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 27 Apr 2024 03:01:29 +0300 Subject: [PATCH] tor: runtime --- src/tor/tor.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tor/tor.rs b/src/tor/tor.rs index 947264c..6e8771f 100644 --- a/src/tor/tor.rs +++ b/src/tor/tor.rs @@ -35,7 +35,8 @@ use ed25519_dalek::hazmat::ExpandedSecretKey; use curve25519_dalek::digest::Digest; use sha2::Sha512; use tor_config::{CfgPath, Listen}; -use tor_rtcompat::{BlockOn, PreferredRuntime, Runtime}; +use tor_rtcompat::tokio::TokioNativeTlsRuntime; +use tor_rtcompat::{BlockOn, Runtime}; use tor_hsrproxy::OnionServiceReverseProxy; use tor_hsrproxy::config::{Encapsulation, ProxyAction, ProxyPattern, ProxyRule, TargetAddr, ProxyConfigBuilder}; use tor_hsservice::config::OnionServiceConfigBuilder; @@ -54,7 +55,7 @@ lazy_static! { /// Tor server to use as SOCKS proxy for requests and to launch Onion services. pub struct TorServer { /// Running Tor client. - client: Arc>>>, + client: Arc>>>, /// Running Tor client configuration. config: Arc>>, @@ -155,7 +156,7 @@ impl TorServer { } }); // Create Tor client. - let runtime = PreferredRuntime::current().unwrap(); + let runtime = TokioNativeTlsRuntime::create().unwrap(); match TorClient::with_runtime(runtime.clone()) .config(config) .bootstrap_behavior(arti_client::BootstrapBehavior::OnDemand)