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 22 pub(crate) mod base64; 23 pub(crate) mod config; 24 pub(crate) mod normalizer; 25 pub(crate) mod pool; 26 pub(crate) mod proxy; 27 pub(crate) mod redirect; 28 29 #[cfg(feature = "async")] 30 pub(crate) mod request; 31 32 #[cfg(feature = "__tls")] 33 pub(crate) mod c_openssl; 34 35 #[cfg(any(feature = "http1_1", feature = "http2"))] 36 pub(crate) mod dispatcher; 37 38 #[cfg(feature = "http3")] 39 pub(crate) mod alt_svc; 40 #[cfg(any(feature = "http3", feature = "http2"))] 41 pub(crate) mod data_ref; 42 #[cfg(feature = "http2")] 43 pub(crate) mod h2; 44 #[cfg(feature = "http3")] 45 pub(crate) mod h3; 46 #[cfg(all(test, feature = "ylong_base"))] 47 pub(crate) mod test_utils; 48 49 #[cfg(feature = "__tls")] 50 pub use c_openssl::{ 51 Cert, Certificate, PubKeyPins, PubKeyPinsBuilder, TlsConfig, TlsConfigBuilder, TlsFileType, 52 TlsVersion, 53 }; 54 #[cfg(feature = "__tls")] 55 pub(crate) use config::{AlpnProtocol, AlpnProtocolList}; 56 #[cfg(feature = "__tls")] 57 pub use config::{CertVerifier, ServerCerts}; 58 pub use config::{Proxy, ProxyBuilder, Redirect, Retry, SpeedLimit, Timeout}; 59 #[cfg(all(feature = "async", feature = "ylong_base", feature = "http2"))] 60 pub(crate) use h2::{split, Reader, Writer}; 61