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 = "__c_openssl")] 33 pub(crate) mod c_openssl; 34 35 #[cfg(any(feature = "http1_1", feature = "http2"))] 36 pub(crate) mod dispatcher; 37 38 #[cfg(feature = "http2")] 39 pub(crate) mod h2; 40 #[cfg(all(test, feature = "ylong_base"))] 41 pub(crate) mod test_utils; 42 43 #[cfg(feature = "__c_openssl")] 44 pub use c_openssl::{ 45 Cert, Certificate, PubKeyPins, PubKeyPinsBuilder, TlsConfig, TlsConfigBuilder, TlsFileType, 46 TlsVersion, 47 }; 48 #[cfg(feature = "__c_openssl")] 49 pub(crate) use config::{AlpnProtocol, AlpnProtocolList}; 50 #[cfg(feature = "__tls")] 51 pub use config::{CertVerifier, ServerCerts}; 52 pub use config::{Proxy, ProxyBuilder, Redirect, Retry, SpeedLimit, Timeout}; 53 #[cfg(all(feature = "async", feature = "ylong_base", feature = "http2"))] 54 pub(crate) use h2::{split, Reader, Writer}; 55