Skip to content
Snippets Groups Projects
Commit e0ddb522 authored by Nick Mathewson's avatar Nick Mathewson :fire:
Browse files

Update READMEs.

parent db649702
No related branches found
Tags tor-0.1.0.5-rc
No related merge requests found
# tor-client
# arti-tor-client
High-level functionality for accessing the Tor network as a client.
(Note that this crate is called `tor-client` in some other places,
since we didn't know about the conflict with `tor_client`. We will
clean all of this up somehow before the next release.)
## Overview
The `tor-client` crate aims to provide a safe, easy-to-use API for
The `arti-tor-client` crate aims to provide a safe, easy-to-use API for
applications that want to use Tor network to anonymize their
traffic. It hides most of the underlying detail, letting other
crates decide how exactly to use the Tor crate.
......
......@@ -18,8 +18,7 @@ yet exists, including:
Additionally, the `AsyncRead` and `AsyncWrite` traits provide by
[`futures`] are not the same as those provided by `tokio`, and
require compatibility wrappers to use. (We re-export those of
[`tokio_util`].
require compatibility wrappers to use.
To solve these problems, the `tor-rtcompat` crate provides a set
of traits that represent a runtime's ability to perform these
......@@ -64,10 +63,10 @@ You can get a [`Runtime`] in several ways:
using for anything besides Arti, you can use [`create_runtime()`].
* If you want to explicitly construct a runtime with a specific
backend, you can do so with `create_async_std_runtime` or
[`create_tokio_runtime`]. Or if you have already constructed a
backend, you can do so with [`async_std::create_async_std_runtime`] or
[`tokio::create_tokio_runtime`]. Or if you have already constructed a
tokio runtime that you want to use, you can wrap it as a
[`Runtime`] explicitly with [`TokioRuntimeHandle`].
[`Runtime`] explicitly with [`tokio::TokioRuntimeHandle`].
## Cargo features
......
......@@ -64,11 +64,12 @@ use tor_rtmock::{MockSleepRuntime,MockNetRuntime,net::MockNetwork};
use tor_rtcompat::{TcpProvider,TcpListener};
use futures::io::AsyncReadExt;
let addr1 = "198.51.100.7".parse().unwrap();
let addr2 = "198.51.100.99".parse().unwrap();
let sockaddr = "198.51.100.99:101".parse().unwrap();
tor_rtcompat::test_with_all_runtimes!(|rt| async move {
let addr1 = "198.51.100.7".parse().unwrap();
let addr2 = "198.51.100.99".parse().unwrap();
let sockaddr = "198.51.100.99:101".parse().unwrap();
tor_rtcompat::test_with_runtime(|rt| async {
// Make a runtime that pretends that we are at the first address...
let fake_internet = MockNetwork::new();
let rt1 = fake_internet.builder().add_address(addr1).runtime(rt.clone());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment