Crates.io | hyper-hickory |
lib.rs | hyper-hickory |
version | 0.8.0 |
created_at | 2023-10-14 22:06:27.804797+00 |
updated_at | 2025-08-04 21:17:47.326338+00 |
description | HTTP connector for hyper that uses hickory's DNS resolver |
homepage | https://github.com/Gelbpunkt/hyper-hickory |
repository | https://github.com/Gelbpunkt/hyper-hickory |
max_upload_size | |
id | 1003314 |
size | 85,944 |
This crate provides a HTTP connector for hyper that uses the fast and advanced DNS resolver of hickory instead of the default threadpool implementation of hyper.
# #![cfg(feature = "tokio")]
# fn main() {
use http_body_util::Full; // Or your preferred Body implementation
use hyper::body::Bytes;
use hyper_hickory::TokioHickoryResolver;
use hyper_util::{client::legacy::Client, rt::TokioExecutor};
let connector = TokioHickoryResolver::default().into_http_connector();
let client: Client<_, Full<Bytes>> = Client::builder(TokioExecutor::new()).build(connector);
# }
There is a [HickoryResolver
] resolver which can be built from an [Resolver
] using [HickoryResolver::from_resolver
].
For most cases where you are happy to use the standard TokioRuntimeProvider
, the [TokioHickoryResolver
] should be used and is able to be built much more easily. It requires enabling the tokio
feature flag.
There are 2 connectors:
HickoryHttpConnector<C>
], a wrapper around [HttpConnector<HickoryResolver<C>>
]. Created with [HickoryResolver::into_http_connector
].TokioHickoryHttpConnector
], an alias to [HickoryHttpConnector<TokioConnectionProvider>
].The crate has other features that toggle functionality in hickory-resolver, such as DNSSEC or DOH / DOT.