hyper-trust-dns-connector

MIT licensed crates.io Released API docs

A crate to make trust-dns-resolver's asynchronous resolver compatible with hyper client, to use instead of the default dns threadpool.

Documentation

Motivations

By default hyper HttpConnector uses the std provided resolver wich is blocking in a threadpool with a configurable number of threads. This crate provides an alternative using trustdnsresolver, a dns resolver written in Rust, with async features.

Example

```rust use hyper::{Body, Client}; use hypertrustdnsconnector::newasynchttpconnector;

[tokio::main]

async fn main() -> Result<(), Box> { let http = newasynchttpconnector()?; let client = Client::builder().build::<_, Body>(http); let statuscode = client .get(hyper::Uri::fromstatic("http://httpbin.org/ip")) .await? .status(); asserteq!(status_code, 200); Ok(()) } ```

Contributing

If you need a feature implemented, or want to help, don't hesitate to open an issue or a PR.

License

Provided under the MIT license (LICENSE or http://opensource.org/licenses/MIT)