hickory_proto/h3/
mod.rs

1// Copyright 2015-2018 Benjamin Fry <benjaminfry@me.com>
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// https://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// https://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8//! TLS protocol related components for DNS over HTTP/3 (DoH3)
9
10mod h3_client_stream;
11pub mod h3_server;
12
13use quinn::{TransportConfig, VarInt};
14
15pub use crate::http::error::{Error as H3Error, Result as H3Result};
16pub use crate::quic::client_config_tls13;
17
18pub use self::h3_client_stream::{
19    H3ClientConnect, H3ClientResponse, H3ClientStream, H3ClientStreamBuilder,
20};
21
22const ALPN_H3: &[u8] = b"h3";
23
24/// Returns a default endpoint configuration for DNS-over-QUIC
25fn transport() -> TransportConfig {
26    let mut transport_config = TransportConfig::default();
27
28    transport_config.datagram_receive_buffer_size(None);
29    transport_config.datagram_send_buffer_size(0);
30    // clients never accept new bidirectional streams
31    transport_config.max_concurrent_bidi_streams(VarInt::from_u32(3));
32    // - SETTINGS
33    // - QPACK encoder
34    // - QPACK decoder
35    // - RESERVED (GREASE)
36    transport_config.max_concurrent_uni_streams(VarInt::from_u32(4));
37
38    transport_config
39}