Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gelbpunkt/hyper-hickory
HTTP/HTTPS connectors for hyper that use hickory's DNS resolver
https://github.com/gelbpunkt/hyper-hickory
Last synced: 5 days ago
JSON representation
HTTP/HTTPS connectors for hyper that use hickory's DNS resolver
- Host: GitHub
- URL: https://github.com/gelbpunkt/hyper-hickory
- Owner: Gelbpunkt
- License: mit
- Created: 2021-10-12T18:54:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T03:46:01.000Z (about 1 year ago)
- Last Synced: 2025-01-08T09:18:18.014Z (8 days ago)
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hyper-hickory
This crate provides a HTTP connector for [hyper](https://github.com/hyperium/hyper) that uses the fast and advanced DNS resolver of [hickory](https://github.com/hickory-dns/hickory-dns) instead of the default threadpool implementation of hyper.
## Usage
```rust
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> = 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`](https://docs.rs/hickory-resolver/latest/hickory_resolver/name_server/struct.TokioRuntimeProvider.html), the [`TokioHickoryResolver`] should be used and is able to be built much more easily.
## Types of connectors
There are 2 connectors:
- [`HickoryHttpConnector`], a wrapper around [`HttpConnector>`]. Created with [`HickoryResolver::into_http_connector`].
- [`TokioHickoryHttpConnector`], an alias to [`HickoryHttpConnector`].## Hickory options
The crate has other features that toggle functionality in [hickory-resolver](https://github.com/hickory-dns/hickory-dns/tree/main/crates/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](https://github.com/hickory-dns/hickory-dns/issues/1708).