1[package]
2name = "hyper"
3version = "1.6.0"
4description = "A protective and efficient HTTP library for all."
5readme = "README.md"
6homepage = "https://hyper.rs"
7documentation = "https://docs.rs/hyper"
8repository = "https://github.com/hyperium/hyper"
9license = "MIT"
10authors = ["Sean McArthur <sean@seanmonstar.com>"]
11keywords = ["http", "hyper", "hyperium"]
12categories = ["network-programming", "web-programming::http-client", "web-programming::http-server"]
13edition = "2021"
14rust-version = "1.63" # keep in sync with MSRV.md dev doc
15
16include = [
17 "Cargo.toml",
18 "LICENSE",
19 "src/**/*",
20]
21
22[dependencies]
23bytes = "1.2"
24http = "1"
25http-body = "1"
26tokio = { version = "1", features = ["sync"] }
27
28# Optional
29
30futures-channel = { version = "0.3", optional = true }
31futures-util = { version = "0.3", default-features = false, optional = true }
32h2 = { version = "0.4.2", optional = true }
33http-body-util = { version = "0.1", optional = true }
34httparse = { version = "1.9", optional = true }
35httpdate = { version = "1.0", optional = true }
36itoa = { version = "1", optional = true }
37pin-project-lite = { version = "0.2.4", optional = true }
38smallvec = { version = "1.12", features = ["const_generics", "const_new"], optional = true }
39tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
40want = { version = "0.3", optional = true }
41
42[dev-dependencies]
43form_urlencoded = "1"
44futures-channel = { version = "0.3", features = ["sink"] }
45futures-util = { version = "0.3", default-features = false, features = ["alloc", "sink"] }
46http-body-util = "0.1"
47pretty_env_logger = "0.5"
48pin-project-lite = "0.2.4"
49spmc = "0.3"
50serde = { version = "1.0", features = ["derive"] }
51serde_json = "1.0"
52tokio = { version = "1", features = [
53 "fs",
54 "macros",
55 "net",
56 "io-std",
57 "io-util",
58 "rt",
59 "rt-multi-thread", # so examples can use #[tokio::main]
60 "sync",
61 "time",
62 "test-util",
63] }
64tokio-test = "0.4"
65tokio-util = "0.7.10"
66
67[features]
68# Nothing by default
69default = []
70
71# Easily turn it all on
72full = [
73 "client",
74 "http1",
75 "http2",
76 "server",
77]
78
79# HTTP versions
80http1 = ["dep:futures-channel", "dep:futures-util", "dep:httparse", "dep:itoa"]
81http2 = ["dep:futures-channel", "dep:futures-util", "dep:h2"]
82
83# Client/Server
84client = ["dep:want", "dep:pin-project-lite", "dep:smallvec"]
85server = ["dep:httpdate", "dep:pin-project-lite", "dep:smallvec"]
86
87# C-API support (currently unstable (no semver))
88ffi = ["dep:http-body-util", "futures-util?/alloc"]
89capi = []
90
91# Utilize tracing (currently unstable)
92tracing = ["dep:tracing"]
93
94# internal features used in CI
95nightly = []
96
97[lints.rust.unexpected_cfgs]
98level = "warn"
99check-cfg = [
100 'cfg(hyper_unstable_tracing)',
101 'cfg(hyper_unstable_ffi)'
102]
103
104[package.metadata.docs.rs]
105features = ["ffi", "full", "tracing"]
106rustdoc-args = ["--cfg", "hyper_unstable_ffi", "--cfg", "hyper_unstable_tracing"]
107
108[package.metadata.playground]
109features = ["full"]
110
111[package.metadata.capi.header]
112generation = false
113subdirectory = false
114
115[package.metadata.capi.install.include]
116asset = [{ from="capi/include/hyper.h" }]
117
118[profile.release]
119codegen-units = 1
120incremental = false
121
122[profile.bench]
123codegen-units = 1
124incremental = false
125
126[[example]]
127name = "client"
128path = "examples/client.rs"
129required-features = ["full"]
130
131[[example]]
132name = "client_json"
133path = "examples/client_json.rs"
134required-features = ["full"]
135
136[[example]]
137name = "echo"
138path = "examples/echo.rs"
139required-features = ["full"]
140
141[[example]]
142name = "gateway"
143path = "examples/gateway.rs"
144required-features = ["full"]
145
146[[example]]
147name = "graceful_shutdown"
148path = "examples/graceful_shutdown.rs"
149required-features = ["full"]
150
151[[example]]
152name = "hello"
153path = "examples/hello.rs"
154required-features = ["full"]
155
156[[example]]
157name = "http_proxy"
158path = "examples/http_proxy.rs"
159required-features = ["full"]
160
161[[example]]
162name = "multi_server"
163path = "examples/multi_server.rs"
164required-features = ["full"]
165
166[[example]]
167name = "params"
168path = "examples/params.rs"
169required-features = ["full"]
170
171[[example]]
172name = "send_file"
173path = "examples/send_file.rs"
174required-features = ["full"]
175
176[[example]]
177name = "service_struct_impl"
178path = "examples/service_struct_impl.rs"
179required-features = ["full"]
180
181[[example]]
182name = "single_threaded"
183path = "examples/single_threaded.rs"
184required-features = ["full"]
185
186[[example]]
187name = "state"
188path = "examples/state.rs"
189required-features = ["full"]
190
191[[example]]
192name = "upgrades"
193path = "examples/upgrades.rs"
194required-features = ["full"]
195
196
197[[example]]
198name = "web_api"
199path = "examples/web_api.rs"
200required-features = ["full"]
201
202
203[[bench]]
204name = "body"
205path = "benches/body.rs"
206required-features = ["full"]
207
208[[bench]]
209name = "connect"
210path = "benches/connect.rs"
211required-features = ["full"]
212
213[[bench]]
214name = "end_to_end"
215path = "benches/end_to_end.rs"
216required-features = ["full"]
217
218[[bench]]
219name = "pipeline"
220path = "benches/pipeline.rs"
221required-features = ["full"]
222
223[[bench]]
224name = "server"
225path = "benches/server.rs"
226required-features = ["full"]
227
228
229[[test]]
230name = "client"
231path = "tests/client.rs"
232required-features = ["full"]
233
234[[test]]
235name = "integration"
236path = "tests/integration.rs"
237required-features = ["full"]
238
239[[test]]
240name = "server"
241path = "tests/server.rs"
242required-features = ["full"]
243