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