I managed to solve it. The root cause was me not digging deep enough into the documentation prior to making this post, however in my defense, it would have been really helpful to have an example somewhere in the documentation.
Now that I am a bit more familiar with the Arti it all makes sense and seems obvious, however, it wasn’t at first. Therefore if someone would be nice enough to point me how can I contribute the code example I would be grateful.
In the meantime here is how I did it:
- First I made my steam stream preferences using “StreamPrefs::new()”
- Then I called “connect_to_onion_services(arti_client::config::BoolOrAuto::Explicit(true))” on my stream preferences
- After building my Tor client I could call “tor_client.connect_with_prefs((address.clone(), port), &s_prefs)” on it to connect using my preferences.
- And finally in your Cargo.toml you must have this feature enabled “arti-client = { version = “0.23.0”, features = [“onion-service-client”]}”