1// Copyright (c) 2023 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14//! Ylong http client utility module.
15//!
16//! A tool module that supports various functions of the http client.
17//!
18//! -[`ClientConfig`] is used to configure a client with options and flags.
19//! -[`HttpConfig`] is used to configure `HTTP` related logic.
20//! -[`HttpVersion`] is used to provide Http Version.
21
22pub(crate) mod base64;
23pub(crate) mod config;
24pub(crate) mod normalizer;
25pub(crate) mod pool;
26pub(crate) mod proxy;
27pub(crate) mod redirect;
28
29#[cfg(feature = "async")]
30pub(crate) mod request;
31
32#[cfg(feature = "__tls")]
33pub(crate) mod c_openssl;
34
35#[cfg(any(feature = "http1_1", feature = "http2"))]
36pub(crate) mod dispatcher;
37
38#[cfg(feature = "http3")]
39pub(crate) mod alt_svc;
40#[cfg(any(feature = "http3", feature = "http2"))]
41pub(crate) mod data_ref;
42#[cfg(feature = "http2")]
43pub(crate) mod h2;
44#[cfg(feature = "http3")]
45pub(crate) mod h3;
46#[cfg(all(test, feature = "ylong_base"))]
47pub(crate) mod test_utils;
48
49#[cfg(feature = "__tls")]
50pub use c_openssl::{
51    Cert, Certificate, PubKeyPins, PubKeyPinsBuilder, TlsConfig, TlsConfigBuilder, TlsFileType,
52    TlsVersion,
53};
54#[cfg(feature = "__tls")]
55pub(crate) use config::{AlpnProtocol, AlpnProtocolList};
56#[cfg(feature = "__tls")]
57pub use config::{CertVerifier, ServerCerts};
58pub use config::{Proxy, ProxyBuilder, Redirect, Retry, SpeedLimit, Timeout};
59#[cfg(all(feature = "async", feature = "ylong_base", feature = "http2"))]
60pub(crate) use h2::{split, Reader, Writer};
61