#dns-resolver #hyper #hyper-client #hickory #connector #default

hyper-hickory

HTTP connector for hyper that uses hickory's DNS resolver

2 unstable releases

0.7.0 Jan 12, 2024
0.6.0 Oct 14, 2023

#419 in HTTP client

Download history 382/week @ 2024-07-22 718/week @ 2024-07-29 559/week @ 2024-08-05 666/week @ 2024-08-12 9/week @ 2024-08-19 1102/week @ 2024-08-26 196/week @ 2024-09-02 258/week @ 2024-09-09 202/week @ 2024-09-16 305/week @ 2024-09-23 572/week @ 2024-09-30 97/week @ 2024-10-07 379/week @ 2024-10-14 387/week @ 2024-10-21 580/week @ 2024-10-28 130/week @ 2024-11-04

1,480 downloads per month
Used in cf-turnstile

MIT license

13KB
138 lines

hyper-hickory

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.

Usage

use http_body_util::Full; // Or your preferred Body implementation
use hyper::body::Bytes;
use hyper_hickory::HickoryResolver;
use hyper_util::{client::legacy::Client, rt::TokioExecutor};

let connector = HickoryResolver::default().into_http_connector();
let client: Client<_, Full<Bytes>> = Client::builder(TokioExecutor::new()).build(connector);

Resolvers

There is a HickoryResolver resolver which can be built from an AsyncResolver using HickoryResolver::from_async_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.

Types of connectors

There are 2 connectors:

Hickory options

The crate has other features that toggle functionality in hickory-resolver, namingly dns-over-openssl, dns-over-native-tls and dns-over-rustls (combined with rustls-webpki or rustls-native) for DNS-over-TLS, dns-over-https-rustls for DNS-over-HTTPS and dnssec-openssl and dnssec-ring for DNSSEC.

A note on DNSSEC

DNSSEC functionality was never actually used if enabled prior to version 0.5.0 of this crate. This has been changed since and might result in sudden, breaking behaviour due to hickory-resolver failing on unsigned records.

This behaviour will continue until DNSSEC is improved in hickory.

Dependencies

~11–25MB
~405K SLoC