wreq-rb 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +1922 -397
- data/LICENSE +203 -0
- data/README.md +19 -15
- data/ext/wreq_rb/Cargo.toml +4 -6
- data/ext/wreq_rb/src/client.rs +41 -48
- data/lib/wreq-rb/version.rb +1 -1
- data/patches/0001-add-transfer-size-tracking.patch +76 -67
- data/vendor/wreq/Cargo.toml +119 -71
- data/vendor/wreq/README.md +25 -20
- data/vendor/wreq/bench/http1.rs +25 -0
- data/vendor/wreq/bench/http1_over_tls.rs +25 -0
- data/vendor/wreq/bench/http2.rs +25 -0
- data/vendor/wreq/bench/http2_over_tls.rs +25 -0
- data/vendor/wreq/bench/support/bench.rs +91 -0
- data/vendor/wreq/bench/support/client.rs +217 -0
- data/vendor/wreq/bench/support/server.rs +188 -0
- data/vendor/wreq/bench/support.rs +56 -0
- data/vendor/wreq/examples/cert_store.rs +4 -4
- data/vendor/wreq/examples/{emulation.rs → emulate.rs} +2 -2
- data/vendor/wreq/examples/http2_websocket.rs +2 -2
- data/vendor/wreq/examples/keylog.rs +3 -3
- data/vendor/wreq/examples/{request_with_emulation.rs → request_with_emulate.rs} +2 -2
- data/vendor/wreq/examples/rt.rs +23 -0
- data/vendor/wreq/src/client/body.rs +23 -61
- data/vendor/wreq/src/client/emulate.rs +119 -0
- data/vendor/wreq/src/client/{http/future.rs → future.rs} +11 -32
- data/vendor/wreq/src/client/{http → layer}/client/pool.rs +66 -61
- data/vendor/wreq/src/client/{http → layer}/client.rs +416 -270
- data/vendor/wreq/src/client/layer/config.rs +27 -6
- data/vendor/wreq/src/client/layer/decoder.rs +9 -4
- data/vendor/wreq/src/client/layer/redirect/future.rs +6 -3
- data/vendor/wreq/src/client/layer/redirect.rs +4 -5
- data/vendor/wreq/src/client/layer/retry.rs +8 -5
- data/vendor/wreq/src/client/layer/timeout/body.rs +15 -6
- data/vendor/wreq/src/client/layer/timeout/future.rs +23 -18
- data/vendor/wreq/src/client/layer/timeout.rs +24 -74
- data/vendor/wreq/src/client/layer.rs +1 -2
- data/vendor/wreq/src/client/multipart.rs +137 -154
- data/vendor/wreq/src/client/request.rs +202 -118
- data/vendor/wreq/src/client/response.rs +46 -45
- data/vendor/wreq/src/client/upgrade.rs +15 -0
- data/vendor/wreq/src/client/ws.rs +73 -25
- data/vendor/wreq/src/client.rs +1655 -17
- data/vendor/wreq/src/config.rs +11 -11
- data/vendor/wreq/src/{client/conn → conn}/connector.rs +139 -137
- data/vendor/wreq/src/conn/descriptor.rs +143 -0
- data/vendor/wreq/src/conn/http.rs +484 -0
- data/vendor/wreq/src/conn/net/io.rs +75 -0
- data/vendor/wreq/src/conn/net/tcp/compio.rs +71 -0
- data/vendor/wreq/src/conn/net/tcp/tokio.rs +57 -0
- data/vendor/wreq/src/conn/net/tcp.rs +561 -0
- data/vendor/wreq/src/conn/net/uds/compio.rs +60 -0
- data/vendor/wreq/src/{client/conn/uds.rs → conn/net/uds/tokio.rs} +18 -12
- data/vendor/wreq/src/conn/net/uds.rs +11 -0
- data/vendor/wreq/src/conn/net.rs +130 -0
- data/vendor/wreq/src/{client/conn → conn}/proxy/socks.rs +2 -9
- data/vendor/wreq/src/{client/conn → conn}/proxy/tunnel.rs +21 -56
- data/vendor/wreq/src/conn/tls_info.rs +47 -0
- data/vendor/wreq/src/{client/conn.rs → conn.rs} +202 -54
- data/vendor/wreq/src/cookie.rs +302 -142
- data/vendor/wreq/src/dns/gai/compio.rs +77 -0
- data/vendor/wreq/src/dns/gai/tokio.rs +90 -0
- data/vendor/wreq/src/dns/gai.rs +14 -164
- data/vendor/wreq/src/dns/hickory.rs +16 -23
- data/vendor/wreq/src/dns/resolve.rs +7 -41
- data/vendor/wreq/src/dns.rs +90 -7
- data/vendor/wreq/src/error.rs +57 -31
- data/vendor/wreq/src/ext.rs +25 -0
- data/vendor/wreq/src/group.rs +211 -0
- data/vendor/wreq/src/header.rs +100 -112
- data/vendor/wreq/src/lib.rs +124 -73
- data/vendor/wreq/src/proxy.rs +6 -20
- data/vendor/wreq/src/redirect.rs +1 -1
- data/vendor/wreq/src/rt.rs +208 -0
- data/vendor/wreq/src/sync.rs +97 -98
- data/vendor/wreq/src/tls/compress.rs +124 -0
- data/vendor/wreq/src/tls/conn/ext.rs +54 -45
- data/vendor/wreq/src/tls/conn/service.rs +14 -18
- data/vendor/wreq/src/tls/conn.rs +169 -241
- data/vendor/wreq/src/tls/keylog.rs +68 -5
- data/vendor/wreq/src/tls/session.rs +205 -0
- data/vendor/wreq/src/tls/{x509 → trust}/identity.rs +4 -21
- data/vendor/wreq/src/tls/{x509/parser.rs → trust/parse.rs} +1 -1
- data/vendor/wreq/src/tls/{x509 → trust}/store.rs +42 -81
- data/vendor/wreq/src/tls/{x509.rs → trust.rs} +8 -2
- data/vendor/wreq/src/tls.rs +489 -25
- data/vendor/wreq/src/trace.rs +0 -12
- data/vendor/wreq/src/util.rs +1 -1
- data/vendor/wreq/tests/badssl.rs +10 -10
- data/vendor/wreq/tests/client.rs +3 -9
- data/vendor/wreq/tests/cookie.rs +6 -8
- data/vendor/wreq/tests/{emulation.rs → emulate.rs} +130 -22
- data/vendor/wreq/tests/multipart.rs +43 -1
- data/vendor/wreq/tests/proxy.rs +1 -1
- data/vendor/wreq/tests/support/layer.rs +1 -0
- metadata +49 -71
- data/patches/0002-add-cancel-connections.patch +0 -181
- data/vendor/wreq/src/client/conn/conn.rs +0 -231
- data/vendor/wreq/src/client/conn/http.rs +0 -1023
- data/vendor/wreq/src/client/conn/tls_info.rs +0 -98
- data/vendor/wreq/src/client/core/body/incoming.rs +0 -485
- data/vendor/wreq/src/client/core/body/length.rs +0 -118
- data/vendor/wreq/src/client/core/body.rs +0 -34
- data/vendor/wreq/src/client/core/common/buf.rs +0 -149
- data/vendor/wreq/src/client/core/common/rewind.rs +0 -141
- data/vendor/wreq/src/client/core/common/watch.rs +0 -76
- data/vendor/wreq/src/client/core/common.rs +0 -3
- data/vendor/wreq/src/client/core/conn/http1.rs +0 -342
- data/vendor/wreq/src/client/core/conn/http2.rs +0 -307
- data/vendor/wreq/src/client/core/conn.rs +0 -11
- data/vendor/wreq/src/client/core/dispatch.rs +0 -299
- data/vendor/wreq/src/client/core/error.rs +0 -435
- data/vendor/wreq/src/client/core/ext.rs +0 -201
- data/vendor/wreq/src/client/core/http1.rs +0 -178
- data/vendor/wreq/src/client/core/http2.rs +0 -483
- data/vendor/wreq/src/client/core/proto/h1/conn.rs +0 -988
- data/vendor/wreq/src/client/core/proto/h1/decode.rs +0 -1170
- data/vendor/wreq/src/client/core/proto/h1/dispatch.rs +0 -684
- data/vendor/wreq/src/client/core/proto/h1/encode.rs +0 -580
- data/vendor/wreq/src/client/core/proto/h1/io.rs +0 -879
- data/vendor/wreq/src/client/core/proto/h1/role.rs +0 -694
- data/vendor/wreq/src/client/core/proto/h1.rs +0 -104
- data/vendor/wreq/src/client/core/proto/h2/client.rs +0 -650
- data/vendor/wreq/src/client/core/proto/h2/ping.rs +0 -539
- data/vendor/wreq/src/client/core/proto/h2.rs +0 -379
- data/vendor/wreq/src/client/core/proto/headers.rs +0 -138
- data/vendor/wreq/src/client/core/proto.rs +0 -58
- data/vendor/wreq/src/client/core/rt/bounds.rs +0 -57
- data/vendor/wreq/src/client/core/rt/timer.rs +0 -150
- data/vendor/wreq/src/client/core/rt/tokio.rs +0 -99
- data/vendor/wreq/src/client/core/rt.rs +0 -25
- data/vendor/wreq/src/client/core/upgrade.rs +0 -267
- data/vendor/wreq/src/client/core.rs +0 -16
- data/vendor/wreq/src/client/emulation.rs +0 -161
- data/vendor/wreq/src/client/http/client/error.rs +0 -142
- data/vendor/wreq/src/client/http/client/exec.rs +0 -29
- data/vendor/wreq/src/client/http/client/extra.rs +0 -77
- data/vendor/wreq/src/client/http/client/util.rs +0 -104
- data/vendor/wreq/src/client/http.rs +0 -1629
- data/vendor/wreq/src/client/layer/config/options.rs +0 -156
- data/vendor/wreq/src/client/layer/cookie.rs +0 -161
- data/vendor/wreq/src/hash.rs +0 -143
- data/vendor/wreq/src/tls/conn/cache.rs +0 -123
- data/vendor/wreq/src/tls/conn/cert_compression.rs +0 -125
- data/vendor/wreq/src/tls/keylog/handle.rs +0 -64
- data/vendor/wreq/src/tls/options.rs +0 -464
- /data/vendor/wreq/src/client/{http → layer}/client/lazy.rs +0 -0
- /data/vendor/wreq/src/{client/conn → conn}/proxy.rs +0 -0
- /data/vendor/wreq/src/{client/conn → conn}/verbose.rs +0 -0
|
@@ -1,60 +1,51 @@
|
|
|
1
|
-
diff --git a/src/client
|
|
2
|
-
index
|
|
3
|
-
--- a/src/client
|
|
4
|
-
+++ b/src/client
|
|
5
|
-
@@ -
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
+
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@@ -
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
+
|
|
1
|
+
diff --git a/src/client.rs b/src/client.rs
|
|
2
|
+
index 4abe25d8..76e709a8 100644
|
|
3
|
+
--- a/src/client.rs
|
|
4
|
+
+++ b/src/client.rs
|
|
5
|
+
@@ -49,6 +49,7 @@ use self::{
|
|
6
|
+
redirect::{FollowRedirect, FollowRedirectLayer},
|
|
7
|
+
retry::RetryPolicy,
|
|
8
|
+
timeout::{Timeout, TimeoutLayer, TimeoutOptions, body::TimeoutBody},
|
|
9
|
+
+ transfer_size::{CountingBody, TransferSizeLayer, TransferSizeService},
|
|
10
|
+
},
|
|
11
|
+
request::{Request, RequestBuilder},
|
|
12
|
+
response::Response,
|
|
13
|
+
@@ -115,25 +116,30 @@ type MaybeDecompressionBody<T> = tower_http::decompression::DecompressionBody<T>
|
|
14
|
+
type ClientService = Timeout<
|
|
15
|
+
ConfigService<
|
|
16
|
+
MaybeDecompression<
|
|
17
|
+
- Retry<RetryPolicy, FollowRedirect<HttpClient<Connector, Body>, FollowRedirectPolicy>>,
|
|
18
|
+
+ TransferSizeService<
|
|
19
|
+
+ Retry<
|
|
20
|
+
+ RetryPolicy,
|
|
21
|
+
+ FollowRedirect<HttpClient<Connector, Body>, FollowRedirectPolicy>,
|
|
22
|
+
+ >,
|
|
23
|
+
+ >,
|
|
24
|
+
>,
|
|
25
|
+
>,
|
|
26
|
+
>;
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-type ResponseBody = TimeoutBody<Incoming>;
|
|
27
|
-
+type ResponseBody = TimeoutBody<CountingBody<Incoming>>;
|
|
28
|
+
type BoxedClientService = BoxCloneSyncService<
|
|
29
|
+
http::Request<Body>,
|
|
30
|
+
- http::Response<TimeoutBody<MaybeDecompressionBody<Incoming>>>,
|
|
31
|
+
+ http::Response<TimeoutBody<MaybeDecompressionBody<CountingBody<Incoming>>>>,
|
|
32
|
+
BoxError,
|
|
33
|
+
>;
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
+
|
|
43
|
-
+ RetryPolicy,
|
|
44
|
-
+ FollowRedirect<
|
|
45
|
-
+ CookieService<
|
|
46
|
-
+ MapErr<
|
|
47
|
-
+ HttpClient<Connector, Body>,
|
|
48
|
-
+ fn(client::error::Error) -> BoxError,
|
|
49
|
-
+ >,
|
|
50
|
-
>,
|
|
51
|
-
+ FollowRedirectPolicy,
|
|
52
|
-
>,
|
|
53
|
-
- FollowRedirectPolicy,
|
|
54
|
-
>,
|
|
55
|
-
>,
|
|
56
|
-
>,
|
|
57
|
-
@@ -582,6 +585,10 @@ impl ClientBuilder {
|
|
35
|
+
type BoxedClientServiceLayer = BoxCloneSyncServiceLayer<
|
|
36
|
+
BoxCloneSyncService<
|
|
37
|
+
http::Request<Body>,
|
|
38
|
+
- http::Response<MaybeDecompressionBody<Incoming>>,
|
|
39
|
+
+ http::Response<MaybeDecompressionBody<CountingBody<Incoming>>>,
|
|
40
|
+
BoxError,
|
|
41
|
+
>,
|
|
42
|
+
http::Request<Body>,
|
|
43
|
+
- http::Response<MaybeDecompressionBody<Incoming>>,
|
|
44
|
+
+ http::Response<MaybeDecompressionBody<CountingBody<Incoming>>>,
|
|
45
|
+
BoxError,
|
|
46
|
+
>;
|
|
47
|
+
|
|
48
|
+
@@ -593,6 +599,10 @@ impl ClientBuilder {
|
|
58
49
|
})
|
|
59
50
|
.service(service);
|
|
60
51
|
|
|
@@ -65,18 +56,36 @@ index 10be0c83..462c77d0 100644
|
|
|
65
56
|
#[cfg(any(
|
|
66
57
|
feature = "gzip",
|
|
67
58
|
feature = "zstd",
|
|
59
|
+
@@ -1585,7 +1595,7 @@ impl ClientBuilder {
|
|
60
|
+
L: Layer<
|
|
61
|
+
BoxCloneSyncService<
|
|
62
|
+
http::Request<Body>,
|
|
63
|
+
- http::Response<MaybeDecompressionBody<Incoming>>,
|
|
64
|
+
+ http::Response<MaybeDecompressionBody<CountingBody<Incoming>>>,
|
|
65
|
+
BoxError,
|
|
66
|
+
>,
|
|
67
|
+
> + Clone
|
|
68
|
+
@@ -1594,7 +1604,7 @@ impl ClientBuilder {
|
|
69
|
+
+ 'static,
|
|
70
|
+
L::Service: Service<
|
|
71
|
+
http::Request<Body>,
|
|
72
|
+
- Response = http::Response<MaybeDecompressionBody<Incoming>>,
|
|
73
|
+
+ Response = http::Response<MaybeDecompressionBody<CountingBody<Incoming>>>,
|
|
74
|
+
Error = BoxError,
|
|
75
|
+
> + Clone
|
|
76
|
+
+ Send
|
|
68
77
|
diff --git a/src/client/layer.rs b/src/client/layer.rs
|
|
69
|
-
index
|
|
78
|
+
index 5c03ef4d..fe37cff0 100644
|
|
70
79
|
--- a/src/client/layer.rs
|
|
71
80
|
+++ b/src/client/layer.rs
|
|
72
|
-
@@ -
|
|
81
|
+
@@ -12,3 +12,4 @@ pub mod decoder;
|
|
73
82
|
pub mod redirect;
|
|
74
83
|
pub mod retry;
|
|
75
84
|
pub mod timeout;
|
|
76
85
|
+pub mod transfer_size;
|
|
77
86
|
diff --git a/src/client/layer/transfer_size.rs b/src/client/layer/transfer_size.rs
|
|
78
87
|
new file mode 100644
|
|
79
|
-
index 00000000..
|
|
88
|
+
index 00000000..f155ec8d
|
|
80
89
|
--- /dev/null
|
|
81
90
|
+++ b/src/client/layer/transfer_size.rs
|
|
82
91
|
@@ -0,0 +1,176 @@
|
|
@@ -91,8 +100,8 @@ index 00000000..7e8a4390
|
|
|
91
100
|
+use std::{
|
|
92
101
|
+ pin::Pin,
|
|
93
102
|
+ sync::{
|
|
94
|
-
+ atomic::{AtomicU64, Ordering},
|
|
95
103
|
+ Arc,
|
|
104
|
+
+ atomic::{AtomicU64, Ordering},
|
|
96
105
|
+ },
|
|
97
106
|
+ task::{Context, Poll},
|
|
98
107
|
+};
|
|
@@ -257,18 +266,18 @@ index 00000000..7e8a4390
|
|
|
257
266
|
+ }
|
|
258
267
|
+}
|
|
259
268
|
diff --git a/src/client/response.rs b/src/client/response.rs
|
|
260
|
-
index
|
|
269
|
+
index 3d3532af..ed478804 100644
|
|
261
270
|
--- a/src/client/response.rs
|
|
262
271
|
+++ b/src/client/response.rs
|
|
263
|
-
@@ -
|
|
264
|
-
use
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
+
|
|
268
|
-
};
|
|
272
|
+
@@ -18,6 +18,7 @@ use mime::Mime;
|
|
273
|
+
use serde::de::DeserializeOwned;
|
|
274
|
+
use wreq_proto::ext::ReasonPhrase;
|
|
275
|
+
|
|
276
|
+
+use super::layer::transfer_size::TransferSizeHandle;
|
|
269
277
|
#[cfg(feature = "cookies")]
|
|
270
278
|
use crate::cookie;
|
|
271
|
-
|
|
279
|
+
use crate::{
|
|
280
|
+
@@ -97,6 +98,21 @@ impl Response {
|
|
272
281
|
HttpBody::size_hint(self.res.body()).exact()
|
|
273
282
|
}
|
|
274
283
|
|
data/vendor/wreq/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "wreq"
|
|
3
|
-
version = "6.0.0-rc.
|
|
3
|
+
version = "6.0.0-rc.29"
|
|
4
4
|
description = "An ergonomic Rust HTTP Client with TLS fingerprint"
|
|
5
5
|
keywords = ["http", "client", "websocket", "ja3", "ja4"]
|
|
6
6
|
categories = ["web-programming::http-client"]
|
|
@@ -19,7 +19,13 @@ rustdoc-args = ["--cfg", "docsrs"]
|
|
|
19
19
|
targets = ["x86_64-unknown-linux-gnu"]
|
|
20
20
|
|
|
21
21
|
[features]
|
|
22
|
-
default = ["webpki-roots"]
|
|
22
|
+
default = ["webpki-roots", "tokio-rt"]
|
|
23
|
+
|
|
24
|
+
# Enable tokio as the async runtime (default).
|
|
25
|
+
tokio-rt = ["tokio/rt", "tokio/net", "tokio/fs", "wreq-rt/tokio-rt"]
|
|
26
|
+
|
|
27
|
+
# Enable compio as the async runtime (completion-based, io_uring/IOCP).
|
|
28
|
+
compio-rt = ["dep:compio", "compio?/runtime", "compio?/net", "wreq-rt/compio-rt"]
|
|
23
29
|
|
|
24
30
|
# Enable support for decoding text.
|
|
25
31
|
charset = ["dep:encoding_rs", "dep:mime"]
|
|
@@ -27,41 +33,41 @@ charset = ["dep:encoding_rs", "dep:mime"]
|
|
|
27
33
|
# Enable cookies store support.
|
|
28
34
|
cookies = ["dep:cookie"]
|
|
29
35
|
|
|
30
|
-
# Enable gzip
|
|
31
|
-
gzip = ["tower-http
|
|
36
|
+
# Enable gzip decompression support.
|
|
37
|
+
gzip = ["dep:tower-http", "tower-http?/decompression-gzip"]
|
|
32
38
|
|
|
33
|
-
# Enable
|
|
34
|
-
brotli = ["tower-http
|
|
39
|
+
# Enable brotli decompression support.
|
|
40
|
+
brotli = ["dep:tower-http", "tower-http?/decompression-br"]
|
|
35
41
|
|
|
36
|
-
# Enable
|
|
37
|
-
zstd = ["tower-http
|
|
42
|
+
# Enable zstd decompression support.
|
|
43
|
+
zstd = ["dep:tower-http", "tower-http?/decompression-zstd"]
|
|
38
44
|
|
|
39
|
-
# Enable deflate
|
|
40
|
-
deflate = ["tower-http
|
|
45
|
+
# Enable deflate decompression support.
|
|
46
|
+
deflate = ["dep:tower-http", "tower-http?/decompression-deflate"]
|
|
41
47
|
|
|
42
48
|
# Enable URL query string serialization support.
|
|
43
|
-
query = ["dep:serde", "dep:
|
|
49
|
+
query = ["dep:serde", "dep:serde_html_form"]
|
|
44
50
|
|
|
45
51
|
# Enable x-www-form-urlencoded form support.
|
|
46
|
-
form = ["dep:serde", "dep:
|
|
52
|
+
form = ["dep:serde", "dep:serde_html_form"]
|
|
47
53
|
|
|
48
54
|
# Enable JSON support.
|
|
49
55
|
json = ["dep:serde", "dep:serde_json"]
|
|
50
56
|
|
|
51
57
|
# Enable multipart/form-data support.
|
|
52
|
-
multipart = ["dep:mime_guess", "dep:sync_wrapper"]
|
|
58
|
+
multipart = ["dep:mime_guess", "dep:sync_wrapper", "sync_wrapper?/futures"]
|
|
53
59
|
|
|
54
60
|
# Enable hickory DNS resolver.
|
|
55
61
|
hickory-dns = ["dep:hickory-resolver"]
|
|
56
62
|
|
|
57
63
|
# Enable streaming support.
|
|
58
|
-
stream = ["
|
|
64
|
+
stream = ["dep:tokio-util", "dep:sync_wrapper", "sync_wrapper?/futures"]
|
|
59
65
|
|
|
60
|
-
# Enable SOCKS proxy support.
|
|
66
|
+
# Enable SOCKS/4/5 proxy support.
|
|
61
67
|
socks = ["dep:tokio-socks"]
|
|
62
68
|
|
|
63
69
|
# Enable WebSocket support.
|
|
64
|
-
ws = ["dep:tokio-tungstenite"]
|
|
70
|
+
ws = ["dep:tokio-tungstenite", "tokio-tungstenite?/handshake"]
|
|
65
71
|
|
|
66
72
|
# Enable webpki-roots for TLS certificate validation.
|
|
67
73
|
webpki-roots = ["dep:webpki-root-certs"]
|
|
@@ -70,52 +76,48 @@ webpki-roots = ["dep:webpki-root-certs"]
|
|
|
70
76
|
system-proxy = ["dep:system-configuration", "dep:windows-registry"]
|
|
71
77
|
|
|
72
78
|
# Enable tracing logging.
|
|
73
|
-
tracing = ["
|
|
79
|
+
tracing = ["dep:tracing", "wreq-proto/tracing"]
|
|
74
80
|
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
# Enables the `parking_lot` crate for synchronization primitives.
|
|
82
|
+
parking_lot = ["dep:parking_lot", "http2/parking_lot"]
|
|
83
|
+
|
|
84
|
+
# Prefix BoringSSL symbols in libcrypto/libssl to avoid linker conflicts
|
|
85
|
+
# when multiple OpenSSL versions coexist in the same process.
|
|
86
|
+
prefix-symbols = ["btls/prefix-symbols"]
|
|
78
87
|
|
|
79
88
|
[dependencies]
|
|
80
|
-
percent-encoding = "2.3.2"
|
|
81
89
|
url = "2.5.8"
|
|
82
|
-
bytes = "1.
|
|
83
|
-
http = "1.
|
|
84
|
-
http2 =
|
|
90
|
+
bytes = "1.11.1"
|
|
91
|
+
http = "1.4.0"
|
|
92
|
+
http2 = "0.5.17"
|
|
85
93
|
httparse = "1.10.1"
|
|
86
94
|
http-body = "1.0.1"
|
|
87
95
|
http-body-util = "0.1.3"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
zstd = "0.13.3"
|
|
96
|
+
percent-encoding = "2.3.2"
|
|
97
|
+
pin-project-lite = "0.2.17"
|
|
98
|
+
futures-util = { version = "0.3.32", default-features = false }
|
|
99
|
+
socket2 = { version = "0.6.3", features = ["all"] }
|
|
100
|
+
ipnet = "2.12.0"
|
|
101
|
+
lru = "0.18.0"
|
|
102
|
+
btls = "0.5.6"
|
|
103
|
+
btls-sys = "0.5.6"
|
|
104
|
+
tokio-btls = "0.5.6"
|
|
105
|
+
tokio = { version = "1.52.3", default-features = false }
|
|
106
|
+
compio = { version = "0.19.0-rc.1", features = ["io", "io-compat"], optional = true }
|
|
107
|
+
wreq-rt = { version = "0.2.2-rc.2", default-features = false }
|
|
108
|
+
wreq-proto = { version = "0.2.3", default-features = false }
|
|
102
109
|
tower = { version = "0.5.3", default-features = false, features = [
|
|
103
110
|
"timeout",
|
|
104
111
|
"util",
|
|
105
112
|
"retry",
|
|
106
113
|
] }
|
|
107
|
-
tokio = { version = "1.48.0", default-features = false, features = [
|
|
108
|
-
"net",
|
|
109
|
-
"time",
|
|
110
|
-
"rt",
|
|
111
|
-
] }
|
|
112
114
|
|
|
113
115
|
# Optional deps...
|
|
114
116
|
|
|
115
117
|
## serde
|
|
116
118
|
serde = { version = "1.0", optional = true }
|
|
117
119
|
serde_json = { version = "1.0", optional = true }
|
|
118
|
-
|
|
120
|
+
serde_html_form = { version = "0.4.0", optional = true }
|
|
119
121
|
|
|
120
122
|
## multipart
|
|
121
123
|
mime_guess = { version = "2.0", default-features = false, optional = true }
|
|
@@ -125,10 +127,10 @@ encoding_rs = { version = "0.8", optional = true }
|
|
|
125
127
|
mime = { version = "0.3.17", optional = true }
|
|
126
128
|
|
|
127
129
|
## sync wrapper
|
|
128
|
-
sync_wrapper = { version = "1.0.2",
|
|
130
|
+
sync_wrapper = { version = "1.0.2", optional = true }
|
|
129
131
|
|
|
130
132
|
## webpki root certs
|
|
131
|
-
webpki-root-certs = { version = "1.0.
|
|
133
|
+
webpki-root-certs = { version = "1.0.7", optional = true }
|
|
132
134
|
|
|
133
135
|
## cookies
|
|
134
136
|
cookie = { version = "0.18", optional = true }
|
|
@@ -136,44 +138,49 @@ cookie = { version = "0.18", optional = true }
|
|
|
136
138
|
## tower http
|
|
137
139
|
tower-http = { version = "0.6.8", default-features = false, optional = true }
|
|
138
140
|
|
|
139
|
-
## tokio
|
|
140
|
-
tokio-util = { version = "0.7.17", default-features = false, optional = true }
|
|
141
|
-
|
|
142
|
-
## socks
|
|
141
|
+
## tokio socks
|
|
143
142
|
tokio-socks = { version = "0.5.2", optional = true }
|
|
144
143
|
|
|
145
|
-
## websocket
|
|
146
|
-
tokio-tungstenite = { version = "0.
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
## tokio websocket
|
|
145
|
+
tokio-tungstenite = { version = "0.29.0", default-features = false, optional = true }
|
|
146
|
+
|
|
147
|
+
## tokio util
|
|
148
|
+
tokio-util = { version = "0.7.18", default-features = false, optional = true }
|
|
149
149
|
|
|
150
150
|
## hickory-dns
|
|
151
|
-
hickory-resolver = { version = "0.
|
|
151
|
+
hickory-resolver = { version = "0.26.0", optional = true }
|
|
152
|
+
|
|
153
|
+
## parking_lot
|
|
154
|
+
parking_lot = { version = "0.12.5", optional = true }
|
|
152
155
|
|
|
153
156
|
## tracing
|
|
154
|
-
tracing = { version = "0.1", default-features = false,
|
|
155
|
-
"std",
|
|
156
|
-
], optional = true }
|
|
157
|
+
tracing = { version = "0.1", default-features = false, optional = true }
|
|
157
158
|
|
|
158
|
-
## windows
|
|
159
|
+
## windows
|
|
159
160
|
[target.'cfg(windows)'.dependencies]
|
|
160
161
|
windows-registry = { version = "0.6.0", optional = true }
|
|
161
162
|
|
|
162
|
-
## macOS
|
|
163
|
+
## macOS
|
|
163
164
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
164
165
|
system-configuration = { version = "0.7.0", optional = true }
|
|
165
166
|
|
|
166
167
|
## interface binding
|
|
167
168
|
[target.'cfg(unix)'.dependencies]
|
|
168
|
-
libc = "0.2.
|
|
169
|
+
libc = "0.2.186"
|
|
169
170
|
|
|
170
171
|
[dev-dependencies]
|
|
172
|
+
wreq-rt = { version = "0.2.2-rc.1", features = ["tokio-rt", "compio-rt"] }
|
|
173
|
+
tokio = { version = "1.0", default-features = false, features = [
|
|
174
|
+
"macros",
|
|
175
|
+
"rt-multi-thread",
|
|
176
|
+
] }
|
|
177
|
+
compio = { version = "0.19.0-rc.1", features = ["macros", "net", "runtime", "time", "io", "io-compat"] }
|
|
171
178
|
hyper = { version = "1.7.0", default-features = false, features = [
|
|
172
179
|
"http1",
|
|
173
180
|
"http2",
|
|
174
181
|
"server",
|
|
175
182
|
] }
|
|
176
|
-
hyper-util = { version = "0.1.
|
|
183
|
+
hyper-util = { version = "0.1.20", features = [
|
|
177
184
|
"http1",
|
|
178
185
|
"http2",
|
|
179
186
|
"server-auto",
|
|
@@ -181,16 +188,52 @@ hyper-util = { version = "0.1.16", features = [
|
|
|
181
188
|
"tokio",
|
|
182
189
|
] }
|
|
183
190
|
serde = { version = "1.0", features = ["derive"] }
|
|
184
|
-
tokio = { version = "1.0", default-features = false, features = [
|
|
185
|
-
"macros",
|
|
186
|
-
"rt-multi-thread",
|
|
187
|
-
] }
|
|
188
191
|
futures = { version = "0.3.0", default-features = false, features = ["std"] }
|
|
189
192
|
tower = { version = "0.5.2", default-features = false, features = ["limit"] }
|
|
190
|
-
tokio-test = "0.4"
|
|
193
|
+
tokio-test = "0.4.5"
|
|
191
194
|
tracing = "0.1"
|
|
192
195
|
tracing-subscriber = "0.3.20"
|
|
193
196
|
pretty_env_logger = "0.5"
|
|
197
|
+
brotli = "8.0.2"
|
|
198
|
+
flate2 = "1.1.9"
|
|
199
|
+
zstd = "0.13.3"
|
|
200
|
+
|
|
201
|
+
# for benchmarks
|
|
202
|
+
sysinfo = { version = "0.39.1", default-features = false, features = ["system"] }
|
|
203
|
+
criterion = { version = "0.8.2", features = ["async_tokio"] }
|
|
204
|
+
reqwest = { version = "0.13.3", default-features = false, features = ["rustls", "stream", "http2"] }
|
|
205
|
+
|
|
206
|
+
[profile.release]
|
|
207
|
+
codegen-units = 1
|
|
208
|
+
incremental = false
|
|
209
|
+
|
|
210
|
+
[profile.bench]
|
|
211
|
+
codegen-units = 1
|
|
212
|
+
incremental = false
|
|
213
|
+
|
|
214
|
+
[[bench]]
|
|
215
|
+
name = "http1"
|
|
216
|
+
path = "bench/http1.rs"
|
|
217
|
+
harness = false
|
|
218
|
+
required-features = ["stream"]
|
|
219
|
+
|
|
220
|
+
[[bench]]
|
|
221
|
+
name = "http2"
|
|
222
|
+
path = "bench/http2.rs"
|
|
223
|
+
harness = false
|
|
224
|
+
required-features = ["stream"]
|
|
225
|
+
|
|
226
|
+
[[bench]]
|
|
227
|
+
name = "http1_over_tls"
|
|
228
|
+
path = "bench/http1_over_tls.rs"
|
|
229
|
+
harness = false
|
|
230
|
+
required-features = ["stream"]
|
|
231
|
+
|
|
232
|
+
[[bench]]
|
|
233
|
+
name = "http2_over_tls"
|
|
234
|
+
path = "bench/http2_over_tls.rs"
|
|
235
|
+
harness = false
|
|
236
|
+
required-features = ["stream"]
|
|
194
237
|
|
|
195
238
|
[[test]]
|
|
196
239
|
name = "cookie"
|
|
@@ -252,8 +295,8 @@ path = "examples/connect_via_lower_priority_tokio_runtime.rs"
|
|
|
252
295
|
required-features = ["tracing"]
|
|
253
296
|
|
|
254
297
|
[[example]]
|
|
255
|
-
name = "
|
|
256
|
-
path = "examples/
|
|
298
|
+
name = "emulate"
|
|
299
|
+
path = "examples/emulate.rs"
|
|
257
300
|
required-features = ["gzip", "brotli", "zstd", "deflate", "tracing"]
|
|
258
301
|
|
|
259
302
|
[[example]]
|
|
@@ -275,8 +318,8 @@ path = "examples/request_with_proxy.rs"
|
|
|
275
318
|
required-features = ["socks"]
|
|
276
319
|
|
|
277
320
|
[[example]]
|
|
278
|
-
name = "
|
|
279
|
-
path = "examples/
|
|
321
|
+
name = "request_with_emulate"
|
|
322
|
+
path = "examples/request_with_emulate.rs"
|
|
280
323
|
required-features = ["gzip", "brotli", "zstd", "deflate", "tracing"]
|
|
281
324
|
|
|
282
325
|
[[example]]
|
|
@@ -304,3 +347,8 @@ path = "examples/keylog.rs"
|
|
|
304
347
|
[[example]]
|
|
305
348
|
name = "unix_socket"
|
|
306
349
|
path = "examples/unix_socket.rs"
|
|
350
|
+
|
|
351
|
+
[[example]]
|
|
352
|
+
name = "rt"
|
|
353
|
+
path = "examples/rt.rs"
|
|
354
|
+
required-features = ["compio-rt"]
|
data/vendor/wreq/README.md
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
[](https://github.com/0x676e67/wreq/blob/main/LICENSE)
|
|
5
5
|
[](https://crates.io/crates/wreq)
|
|
6
6
|
[](https://crates.io/crates/wreq)
|
|
7
|
-
[![
|
|
7
|
+
[![Discord chat][discord-badge]][discord-url]
|
|
8
|
+
|
|
9
|
+
[discord-badge]: https://img.shields.io/discord/1486741856397164788.svg?logo=discord
|
|
10
|
+
[discord-url]: https://discord.gg/rfbvyFkgq3
|
|
8
11
|
|
|
9
12
|
> 🚀 Help me work seamlessly with open source sharing by [sponsoring me on GitHub](https://github.com/0x676e67/0x676e67/blob/main/SPONSOR.md)
|
|
10
13
|
|
|
11
|
-
An ergonomic and modular Rust HTTP
|
|
14
|
+
An ergonomic and modular Rust HTTP Client for high-fidelity protocol matching, featuring customizable TLS, JA3/JA4, and HTTP/2 signature capabilities.
|
|
12
15
|
|
|
13
16
|
## Features
|
|
14
17
|
|
|
@@ -21,8 +24,9 @@ An ergonomic and modular Rust HTTP client for advanced and low-level emulation,
|
|
|
21
24
|
- Tower Middleware
|
|
22
25
|
- WebSocket Upgrade
|
|
23
26
|
- HTTPS via BoringSSL
|
|
24
|
-
- HTTP/2 over TLS
|
|
27
|
+
- HTTP/2 over TLS Parity
|
|
25
28
|
- Certificate Store (CAs & mTLS)
|
|
29
|
+
- Multiple Runtime (Tokio, Compio)
|
|
26
30
|
|
|
27
31
|
## Example
|
|
28
32
|
|
|
@@ -31,8 +35,8 @@ The following example uses the [Tokio](https://tokio.rs) runtime with optional f
|
|
|
31
35
|
```toml
|
|
32
36
|
[dependencies]
|
|
33
37
|
tokio = { version = "1", features = ["full"] }
|
|
34
|
-
wreq = "6.0.0-rc
|
|
35
|
-
wreq-util = "3.0.0-rc
|
|
38
|
+
wreq = "6.0.0-rc"
|
|
39
|
+
wreq-util = "3.0.0-rc"
|
|
36
40
|
```
|
|
37
41
|
|
|
38
42
|
And then the code:
|
|
@@ -67,18 +71,13 @@ Due to the complexity of **TLS** encryption and the widespread adoption of **HTT
|
|
|
67
71
|
|
|
68
72
|
- **Device Emulation**
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
**TLS** and **HTTP/2** fingerprints are often identical across various browser models because these underlying protocols evolve slower than browser release cycles. **100+ browser device emulation profiles** are maintained in [wreq-util](https://github.com/0x676e67/wreq-util).
|
|
71
75
|
|
|
72
76
|
## Building
|
|
73
77
|
|
|
74
|
-
Compiling alongside **openssl-sys** can cause symbol conflicts with **
|
|
75
|
-
|
|
76
|
-
```toml
|
|
77
|
-
[dependencies]
|
|
78
|
-
wreq = { version = "6.0.0-rc.27", features = ["prefix-symbols"] }
|
|
79
|
-
```
|
|
78
|
+
Compiling alongside **openssl-sys** can cause symbol conflicts with **boringssl** that lead to [link failures](https://github.com/cloudflare/boring/issues/197), and on **Linux** and **Android** this can be avoided by enabling the **`prefix-symbols`** feature.
|
|
80
79
|
|
|
81
|
-
Install
|
|
80
|
+
Install [BoringSSL build dependencies](https://github.com/google/boringssl/blob/master/BUILDING.md#build-prerequisites) and build with:
|
|
82
81
|
|
|
83
82
|
```bash
|
|
84
83
|
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools git -y
|
|
@@ -101,21 +100,27 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
|
|
|
101
100
|
|
|
102
101
|
## Sponsors
|
|
103
102
|
|
|
104
|
-
<a href="https://
|
|
103
|
+
<a href="https://captcha.fun/?utm_source=github&utm_medium=readme&utm_campaign=wreq" target="_blank"><img src="https://www.captcha.fun/banner.jpg" height="47" width="149"></a>
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
**Solve reCAPTCHA in less than 2 seconds**
|
|
107
106
|
|
|
108
|
-
**
|
|
107
|
+
**[Captcha.fun](https://captcha.fun/?utm_source=github&utm_medium=readme&utm_campaign=wreq)** delivers fast, reliable CAPTCHA solving built for automation at scale.
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
With simple API integration, consistent performance, and competitive pricing, it's an easy way to keep your workflows moving without delays—use code **`WREQ`** for **10% bonus credits**.
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
**[Dashboard](https://dash.captcha.fun/)** | **[Docs](http://docs.captcha.fun/)** | **[Discord](https://discord.gg/captchafun)**
|
|
113
112
|
|
|
114
113
|
---
|
|
115
114
|
|
|
116
|
-
<a href="https://
|
|
115
|
+
<a href="https://hypersolutions.co/?utm_source=github&utm_medium=readme&utm_campaign=wreq" target="_blank"><img src="https://raw.githubusercontent.com/0x676e67/wreq/main/.github/assets/hypersolutions.jpg" height="47" width="149"></a>
|
|
116
|
+
|
|
117
|
+
TLS fingerprinting alone isn't enough for modern bot protection. **[Hyper Solutions](https://hypersolutions.co?utm_source=github&utm_medium=readme&utm_campaign=wreq)** provides the missing piece - API endpoints that generate valid antibot tokens for:
|
|
118
|
+
|
|
119
|
+
**Akamai** • **DataDome** • **Kasada** • **Incapsula**
|
|
120
|
+
|
|
121
|
+
No browser automation. Just simple API calls that return the exact cookies and headers these systems require.
|
|
117
122
|
|
|
118
|
-
[
|
|
123
|
+
**[Dashboard](https://hypersolutions.co?utm_source=github&utm_medium=readme&utm_campaign=wreq)** | **[Docs](https://docs.justhyped.dev)** | **[Discord](https://discord.gg/akamai)**
|
|
119
124
|
|
|
120
125
|
## Accolades
|
|
121
126
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//! HTTP/1.1 benchmark
|
|
2
|
+
|
|
3
|
+
mod support;
|
|
4
|
+
|
|
5
|
+
use std::time::Duration;
|
|
6
|
+
|
|
7
|
+
use criterion::{Criterion, criterion_group, criterion_main};
|
|
8
|
+
use support::{HttpVersion, Tls, bench};
|
|
9
|
+
|
|
10
|
+
const NUM_REQUESTS_TO_SEND: usize = 500;
|
|
11
|
+
|
|
12
|
+
#[inline]
|
|
13
|
+
fn bench(c: &mut Criterion) {
|
|
14
|
+
bench::bench(c, Tls::Disabled, HttpVersion::Http1, NUM_REQUESTS_TO_SEND)
|
|
15
|
+
.expect("Failed to run HTTP/1 benchmark server")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
criterion_group!(
|
|
19
|
+
name = benches;
|
|
20
|
+
config = Criterion::default()
|
|
21
|
+
.sample_size(10)
|
|
22
|
+
.warm_up_time(Duration::from_secs(3));
|
|
23
|
+
targets = bench
|
|
24
|
+
);
|
|
25
|
+
criterion_main!(benches);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//! HTTP/1.1 over TLS benchmark
|
|
2
|
+
|
|
3
|
+
mod support;
|
|
4
|
+
|
|
5
|
+
use std::time::Duration;
|
|
6
|
+
|
|
7
|
+
use criterion::{Criterion, criterion_group, criterion_main};
|
|
8
|
+
use support::{HttpVersion, Tls, bench};
|
|
9
|
+
|
|
10
|
+
const NUM_REQUESTS_TO_SEND: usize = 500;
|
|
11
|
+
|
|
12
|
+
#[inline]
|
|
13
|
+
fn bench(c: &mut Criterion) {
|
|
14
|
+
bench::bench(c, Tls::Enabled, HttpVersion::Http1, NUM_REQUESTS_TO_SEND)
|
|
15
|
+
.expect("Failed to run HTTP/1 over TLS benchmark server")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
criterion_group!(
|
|
19
|
+
name = benches;
|
|
20
|
+
config = Criterion::default()
|
|
21
|
+
.sample_size(10)
|
|
22
|
+
.warm_up_time(Duration::from_secs(3));
|
|
23
|
+
targets = bench
|
|
24
|
+
);
|
|
25
|
+
criterion_main!(benches);
|