1[package]
2name = "ylong_http_client"
3version = "1.0.0"
4edition = "2021"
5description = "Ylong HTTP Client implementation"
6license = "Apache-2.0"
7repository = "https://gitee.com/openharmony/commonlibrary_rust_ylong_http"
8keywords = ["ylong", "http", "client"]
9
10[dependencies]
11ylong_http = { path = "../ylong_http" }
12quiche = { version = "0.22.0", features = ["ffi"], optional = true }
13libc = { version = "0.2.134", optional = true }
14tokio = { version = "1.20.1", features = ["io-util", "net", "rt", "rt-multi-thread", "macros", "sync", "time"], optional = true }
15ylong_runtime = { git = "https://gitee.com/openharmony/commonlibrary_rust_ylong_runtime.git", features = ["net", "sync", "fs", "macros", "time"], optional = true }
16
17[dev-dependencies]
18hyper = { version = "0.14.23", features = ["http1", "http2", "tcp", "server"] }
19openssl = { version = "0.10.29" }
20tokio-openssl = { version = "0.6.3" }
21
22[features]
23default = []
24full = [
25    "tokio_base",
26    "sync",
27    "async",
28    "http1_1",
29    "tls_default",
30]
31
32sync = []                               # Uses sync interfaces.
33async = []                              # Uses async interfaces.
34http1_1 = ["ylong_http/http1_1"]        # Uses HTTP/1.1.
35http2 = ["ylong_http/http2", "ylong_http/huffman"]               # Uses HTTP/2.
36http3 = ["ylong_http/http3", "quiche", "ylong_http/huffman"]     # Uses HTTP/3.
37
38tokio_base = ["tokio", "ylong_http/tokio_base"]                  # Uses tokio runtime.
39ylong_base = ["ylong_runtime", "ylong_http/ylong_base"]          # Uses ylong runtime.
40
41tls_default = ["c_openssl_3_0"]
42__tls = []                              # Not open to user, only mark to use tls for developer.
43__c_openssl = ["__tls", "libc"]         # Not open to user, only mark to use tls by C-openssl for developer.
44c_openssl_1_1 = ["__c_openssl"]         # Uses TLS by FFI of C-openssl 1.1.
45c_openssl_3_0 = ["__c_openssl"]         # Uses TLS by FFI of C-openssl 3.0.
46c_boringssl = ["__tls", "libc"]
47
48[[example]]
49name = "async_certs_adapter"
50path = "examples/async_certs_adapter.rs"
51required-features = ["async", "http1_1", "ylong_base", "__c_openssl"]
52
53[[example]]
54name = "async_http"
55path = "examples/async_http.rs"
56required-features = ["async", "http1_1", "ylong_base"]
57
58[[example]]
59name = "async_http_multi"
60path = "examples/async_http_multi.rs"
61required-features = ["async", "http1_1", "ylong_base"]
62
63[[example]]
64name = "async_https_outside"
65path = "./examples/async_https_outside.rs"
66required-features = ["async", "http1_1", "__tls", "tokio_base"]
67
68[[example]]
69name = "sync_https_outside"
70path = "./examples/sync_https_outside.rs"
71required-features = ["sync", "http1_1", "__tls"]
72
73[[example]]
74name = "async_proxy_http"
75path = "examples/async_proxy_http.rs"
76required-features = ["async", "http1_1", "tokio_base"]
77
78[[example]]
79name = "async_redirect_http"
80path = "examples/async_redirect_http.rs"
81required-features = ["async", "http1_1", "tokio_base"]
82
83[[example]]
84name = "sync_http"
85path = "examples/sync_http.rs"
86required-features = ["sync", "http1_1"]
87
88[[example]]
89name = "sync_redirect_http"
90path = "examples/sync_redirect_http.rs"
91required-features = ["sync", "http1_1"]
92
93[[example]]
94name = "sync_proxy_http"
95path = "examples/sync_proxy_http.rs"
96required-features = ["sync", "http1_1"]
97