-
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathCargo.toml
More file actions
384 lines (304 loc) · 9.98 KB
/
Copy pathCargo.toml
File metadata and controls
384 lines (304 loc) · 9.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
[package]
name = "wreq"
version = "0.16.1"
description = "An ergonomic, privacy-aware Rust HTTP Client"
keywords = ["http", "client", "websocket", "ja3", "ja4"]
categories = ["web-programming::http-client"]
repository = "https://github.com/0x676e67/wreq"
documentation = "https://docs.rs/wreq"
authors = ["0x676e67 <gngppz@gmail.com>"]
readme = "README.md"
license = "Apache-2.0"
edition = "2024"
rust-version = "1.98"
include = ["/README.md", "/LICENSE", "/src/**/*.rs"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu"]
[features]
default = ["chromium-roots", "tokio-rt"]
# Enable tokio as the async runtime (default).
tokio-rt = ["tokio/rt", "tokio/net", "tokio/fs", "wreq-rt/tokio-rt"]
# Enable compio as the async runtime (completion-based, io_uring/IOCP).
compio-rt = ["dep:compio", "compio?/runtime", "compio?/net", "wreq-rt/compio-rt"]
# Enable support for decoding text.
charset = ["dep:encoding_rs", "dep:mime"]
# Enable cookies store support.
cookies = ["dep:cookie"]
# Enable gzip decompression support.
gzip = ["dep:tower-http", "tower-http?/decompression-gzip"]
# Enable brotli decompression support.
brotli = ["dep:tower-http", "tower-http?/decompression-br"]
# Enable zstd decompression support.
zstd = ["dep:tower-http", "tower-http?/decompression-zstd"]
# Enable deflate decompression support.
deflate = ["dep:tower-http", "tower-http?/decompression-deflate"]
# Enable URL query string serialization support.
query = ["dep:serde", "dep:serde_html_form"]
# Enable x-www-form-urlencoded form support.
form = ["dep:serde", "dep:serde_html_form"]
# Enable JSON support.
json = ["dep:serde", "dep:serde_json"]
# Enable multipart/form-data support.
multipart = ["dep:mime_guess", "dep:sync_wrapper", "sync_wrapper?/futures"]
# Enable hickory DNS resolver.
hickory-dns = ["dep:hickory-resolver"]
# Enable streaming support.
stream = ["dep:tokio-util", "dep:sync_wrapper", "sync_wrapper?/futures"]
# Enable SOCKS/4/5 proxy support.
socks = ["dep:tokio-socks"]
# Enable WebSocket support.
ws = ["dep:tokio-tungstenite", "tokio-tungstenite?/handshake"]
# Use static Chromium Root Store certificates for TLS verification (default).
chromium-roots = ["dep:chromium-roots"]
# Use static Mozilla root certificates for TLS verification.
webpki-roots = ["dep:webpki-root-certs"]
# Use the system's proxy configuration.
system-proxy = ["dep:system-configuration", "dep:windows-registry"]
# Enable tracing logging.
tracing = ["dep:tracing", "wreq-proto/tracing"]
# Enables the `parking_lot` crate for synchronization primitives.
parking_lot = ["dep:parking_lot", "http2/parking_lot"]
# Prefix BoringSSL symbols in libcrypto/libssl to avoid linker conflicts
# when multiple OpenSSL versions coexist in the same process.
prefix-symbols = ["btls/prefix-symbols"]
[dependencies]
url = "2.5.8"
bytes = "1.11.1"
http = "1.4.0"
http2 = "0.5.17"
httparse = "1.10.1"
http-body = "1.0.1"
http-body-util = "0.1.4"
percent-encoding = "2.3.2"
pin-project-lite = "0.2.17"
futures-util = { version = "0.3.33", default-features = false }
socket2 = { version = "0.6.3", features = ["all"] }
ipnet = "2.12.0"
lru = "0.18.0"
btls = "0.5.6"
btls-sys = "0.5.6"
tokio-btls = "0.5.6"
tokio = { version = "1.52.3", default-features = false }
compio = { version = "0.19.2", features = ["io", "io-compat"], optional = true }
wreq-rt = { version = "0.2.2-rc.2", default-features = false }
wreq-proto = { version = "0.2.3", default-features = false }
tower = { version = "0.5.3", default-features = false, features = [
"timeout",
"util",
"retry",
] }
# Optional deps...
## serde
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
serde_html_form = { version = "0.4.0", optional = true }
## multipart
mime_guess = { version = "2.0", default-features = false, optional = true }
## charset
encoding_rs = { version = "0.8", optional = true }
mime = { version = "0.3.17", optional = true }
## sync wrapper
sync_wrapper = { version = "1.0.2", optional = true }
## webpki root certs
webpki-root-certs = { version = "1.0.7", optional = true }
## Chromium root certs
chromium-roots = { version = "0.1.1", optional = true }
## cookies
cookie = { version = "0.18", optional = true }
## tower http
tower-http = { version = "0.7.1", default-features = false, optional = true }
## tokio socks
tokio-socks = { version = "0.5.2", optional = true }
## tokio websocket
tokio-tungstenite = { version = "0.29.0", default-features = false, optional = true }
## tokio util
tokio-util = { version = "0.7.18", default-features = false, optional = true }
## hickory-dns
hickory-resolver = { version = "0.26.0", optional = true }
## parking_lot
parking_lot = { version = "0.12.5", optional = true }
## tracing
tracing = { version = "0.1", default-features = false, optional = true }
## windows
[target.'cfg(windows)'.dependencies]
windows-registry = { version = "0.6.0", optional = true }
## macOS
[target.'cfg(target_os = "macos")'.dependencies]
system-configuration = { version = "0.8.0", optional = true }
## interface binding
[target.'cfg(unix)'.dependencies]
libc = "0.2.186"
[dev-dependencies]
wreq-rt = { version = "0.2.2-rc.1", features = ["tokio-rt", "compio-rt"] }
tokio = { version = "1.0", default-features = false, features = [
"macros",
"rt-multi-thread",
] }
compio = { version = "0.19.2", features = ["macros", "net", "runtime", "time", "io", "io-compat"] }
hyper = { version = "1.7.0", default-features = false, features = [
"http1",
"http2",
"server",
] }
hyper-util = { version = "0.1.20", features = [
"http1",
"http2",
"server-auto",
"server-graceful",
"tokio",
] }
serde = { version = "1.0", features = ["derive"] }
futures = { version = "0.3.0", default-features = false, features = ["std"] }
tower = { version = "0.5.2", default-features = false, features = ["limit"] }
tokio-test = "0.4.5"
tracing = "0.1"
tracing-subscriber = "0.3.20"
pretty_env_logger = "0.5"
brotli = "8.0.2"
flate2 = "1.1.9"
zstd = "0.13.3"
# for benchmarks
sysinfo = { version = "0.39.1", default-features = false, features = ["system"] }
criterion = { version = "0.8.2", features = ["async_tokio"] }
reqwest = { version = "0.13.3", default-features = false, features = ["rustls", "stream", "http2"] }
cyper = { version = "0.9.0", default-features = false, features = ["rustls", "stream", "http2"] }
[profile.release]
codegen-units = 1
incremental = false
[profile.bench]
codegen-units = 1
incremental = false
[[bench]]
name = "http1_current_thread"
path = "bench/http1_current_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http1_multi_thread"
path = "bench/http1_multi_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http2_current_thread"
path = "bench/http2_current_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http2_multi_thread"
path = "bench/http2_multi_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http1_over_tls_current_thread"
path = "bench/http1_over_tls_current_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http1_over_tls_multi_thread"
path = "bench/http1_over_tls_multi_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http2_over_tls_current_thread"
path = "bench/http2_over_tls_current_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[bench]]
name = "http2_over_tls_multi_thread"
path = "bench/http2_over_tls_multi_thread.rs"
harness = false
required-features = ["tokio-rt", "stream"]
[[test]]
name = "cookie"
path = "tests/cookie.rs"
required-features = ["cookies"]
[[test]]
name = "gzip"
path = "tests/gzip.rs"
required-features = ["gzip", "stream"]
[[test]]
name = "brotli"
path = "tests/brotli.rs"
required-features = ["brotli", "stream"]
[[test]]
name = "zstd"
path = "tests/zstd.rs"
required-features = ["zstd", "stream"]
[[test]]
name = "deflate"
path = "tests/deflate.rs"
required-features = ["deflate", "stream"]
[[test]]
name = "multipart"
path = "tests/multipart.rs"
required-features = ["multipart", "stream"]
[[test]]
name = "retry"
path = "tests/retry.rs"
[[example]]
name = "json_dynamic"
path = "examples/json_dynamic.rs"
required-features = ["json"]
[[example]]
name = "json_typed"
path = "examples/json_typed.rs"
required-features = ["json"]
[[example]]
name = "form"
path = "examples/form.rs"
required-features = ["form"]
[[example]]
name = "connect_via_lower_priority_tokio_runtime"
path = "examples/connect_via_lower_priority_tokio_runtime.rs"
required-features = ["tracing"]
[[example]]
name = "emulate"
path = "examples/emulate.rs"
required-features = ["gzip", "brotli", "zstd", "deflate", "tracing"]
[[example]]
name = "cert_store"
path = "examples/cert_store.rs"
required-features = ["webpki-roots"]
[[example]]
name = "request_with_redirect"
path = "examples/request_with_redirect.rs"
[[example]]
name = "request_with_version"
path = "examples/request_with_version.rs"
[[example]]
name = "request_with_proxy"
path = "examples/request_with_proxy.rs"
required-features = ["socks"]
[[example]]
name = "request_with_emulate"
path = "examples/request_with_emulate.rs"
required-features = ["gzip", "brotli", "zstd", "deflate", "tracing"]
[[example]]
name = "request_with_local_address"
path = "examples/request_with_local_address.rs"
[[example]]
name = "request_with_interface"
path = "examples/request_with_interface.rs"
[[example]]
name = "http1_websocket"
path = "examples/http1_websocket.rs"
required-features = ["ws", "futures-util/std"]
[[example]]
name = "http2_websocket"
path = "examples/http2_websocket.rs"
required-features = ["ws", "futures-util/std"]
[[example]]
name = "keylog"
path = "examples/keylog.rs"
[[example]]
name = "unix_socket"
path = "examples/unix_socket.rs"
[[example]]
name = "rt"
path = "examples/rt.rs"
required-features = ["compio-rt"]
[patch.crates-io]
btls = { git = "https://github.com/0x676e67/btls", branch = "main" }
btls-sys = { git = "https://github.com/0x676e67/btls", branch = "main" }