arti_client: No easy way to set connect preferences
Summary
The current implementation does not allow setting of the StreamPrefs
without cloning the client.
For example, usually you could pass the StreamPrefs
to the connect_with_prefs
method but in the case of arti-hyper
the ArtiHttpConnector
only ever calls connect
.
To set the Stream Preferences in this case, you would have to do something like this:
let redundent_client = TorClient::create_bootstrapped(TorClientConfig::default()).await?;
let stream_prefs = StreamPrefs::new();
stream_prefs.isolate_every_stream();
let client = redundent_client.clone_with_prefs(stream_prefs);
drop(redundent_client);
This is an issue because you would want to isolate every stream in the ArtiHttpConnector
and there is no good way to do that right now.
What is the expected behavior?
I would suggest that we make the set_connect_prefs
method on the TorClient
public #250.