wreq 1.3.1-x86_64-linux → 1.3.3-x86_64-linux
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/README.md +1 -1
- data/crates/wreq-util/CHANGELOG.md +1 -0
- data/crates/wreq-util/README.md +4 -2
- data/lib/wreq.rb +9 -9
- data/lib/wreq_ruby/3.3/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/3.4/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/4.0/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/client.rb +39 -25
- data/lib/wreq_ruby/emulate.rb +7 -2
- data/lib/wreq_ruby/http.rb +9 -2
- data/test/emulation_test.rb +3 -1
- data/test/option_validation_test.rb +13 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc885805ee98f65d039986c6a6553a0ed313c539d719481319327584b2424fff
|
|
4
|
+
data.tar.gz: ff6e24596a88a36f7d24bf31b36ef45bf17496963562518b45dedf0509527503
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccf0d7a4addb4f225d0e2a7e73d06d0c8e0b71085bd6befc0869d3c13f9ae56e4465d194c67d586db7bf6430d17fde9f96d269803571563899005b9e3b38a1bb
|
|
7
|
+
data.tar.gz: 5302fb306037aa685267dc484cd74e98e4f898d0112542089019179c9425d06459dfe8925f01ecd437a14b280b6a1ac27ad7748462b8207445f4b7075c13c307
|
data/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Most browser device models share identical TLS and HTTP/2 configurations, differ
|
|
|
91
91
|
|
|
92
92
|
| **Browser** | **Versions** |
|
|
93
93
|
| ----------- | ------------ |
|
|
94
|
-
| **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137`, `Chrome138`, `Chrome139`, `Chrome140`, `Chrome141`, `Chrome142`, `Chrome143`, `Chrome144`, `Chrome145`, `Chrome146`, `Chrome147`, `Chrome148`, `Chrome149`, `Chrome150`, `Chrome151`, `Chrome152`, `Chrome153`, `Chrome154`, `Chrome155` |
|
|
94
|
+
| **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137`, `Chrome138`, `Chrome139`, `Chrome140`, `Chrome141`, `Chrome142`, `Chrome143`, `Chrome144`, `Chrome145`, `Chrome146`, `Chrome147`, `Chrome148`, `Chrome149`, `Chrome150`, `Chrome151`, `Chrome152`, `Chrome153`, `Chrome154`, `Chrome155`, `Chrome156`, `Chrome157` |
|
|
95
95
|
| **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134`, `Edge135`, `Edge136`, `Edge137`, `Edge138`, `Edge139`, `Edge140`, `Edge141`, `Edge142`, `Edge143`, `Edge144`, `Edge145`, `Edge146`, `Edge147`, `Edge148` |
|
|
96
96
|
| **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139`, `Firefox142`, `Firefox143`, `Firefox144`, `Firefox145`, `Firefox146`, `Firefox147`, `Firefox148`, `Firefox149`, `Firefox150`, `Firefox151`, `Firefox152` |
|
|
97
97
|
| **Safari** | `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari17_6`, `Safari18`, `Safari18_2`, `Safari18_3`, `Safari18_3_1`, `Safari18_5`, `Safari26`, `Safari26_1`, `Safari26_2`, `SafariIos16_5`, `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos18_1_1`, `SafariIos26`, `SafariIos26_2`, `SafariIPad18`, `SafariIPad26`, `SafariIpad26_2` |
|
|
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
14
|
- *(emulate)* Add Chrome 153 profile.
|
|
15
15
|
- *(emulate)* Add Chrome 154 profile.
|
|
16
16
|
- *(emulate)* Add Chrome 155 profile, including the JPEG XL navigation Accept header.
|
|
17
|
+
- *(emulate)* Add Chrome 156 profile.
|
|
17
18
|
- *(emulate)* Add Firefox 152 profile.
|
|
18
19
|
|
|
19
20
|
### Fixed
|
data/crates/wreq-util/README.md
CHANGED
|
@@ -20,12 +20,14 @@ See the [crate documentation](https://docs.rs/wreq-util/latest/wreq_util) for mo
|
|
|
20
20
|
|
|
21
21
|
## Example
|
|
22
22
|
|
|
23
|
+
This vendored copy uses the development wreq revision pinned in the [root Cargo.toml](../../Cargo.toml). Building it independently requires the same Git patches.
|
|
24
|
+
|
|
23
25
|
The following example uses the [Tokio](https://tokio.rs) runtime with optional features enabled by adding this to your `Cargo.toml`:
|
|
24
26
|
|
|
25
27
|
```toml
|
|
26
28
|
[dependencies]
|
|
27
29
|
tokio = { version = "1", features = ["full"] }
|
|
28
|
-
wreq = "
|
|
30
|
+
wreq = "0.16.1"
|
|
29
31
|
wreq-util = "3.0.0-rc"
|
|
30
32
|
```
|
|
31
33
|
|
|
@@ -38,7 +40,7 @@ use wreq_util::Emulation;
|
|
|
38
40
|
#[tokio::main]
|
|
39
41
|
async fn main() -> wreq::Result<()> {
|
|
40
42
|
// Build a client
|
|
41
|
-
let client = Client::
|
|
43
|
+
let client = Client::builder_tokio()
|
|
42
44
|
.emulation(Emulation::Chrome147)
|
|
43
45
|
.build()?;
|
|
44
46
|
|
data/lib/wreq.rb
CHANGED
|
@@ -76,7 +76,7 @@ unless defined?(Wreq)
|
|
|
76
76
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
77
77
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
78
78
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
79
|
-
# @param read_timeout [Integer, nil]
|
|
79
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
80
80
|
# @param proxy [String, nil] Proxy server URI
|
|
81
81
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
82
82
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -110,7 +110,7 @@ unless defined?(Wreq)
|
|
|
110
110
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
111
111
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
112
112
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
113
|
-
# @param read_timeout [Integer, nil]
|
|
113
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
114
114
|
# @param proxy [String, nil] Proxy server URI
|
|
115
115
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
116
116
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -144,7 +144,7 @@ unless defined?(Wreq)
|
|
|
144
144
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
145
145
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
146
146
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
147
|
-
# @param read_timeout [Integer, nil]
|
|
147
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
148
148
|
# @param proxy [String, nil] Proxy server URI
|
|
149
149
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
150
150
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -178,7 +178,7 @@ unless defined?(Wreq)
|
|
|
178
178
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
179
179
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
180
180
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
181
|
-
# @param read_timeout [Integer, nil]
|
|
181
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
182
182
|
# @param proxy [String, nil] Proxy server URI
|
|
183
183
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
184
184
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -212,7 +212,7 @@ unless defined?(Wreq)
|
|
|
212
212
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
213
213
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
214
214
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
215
|
-
# @param read_timeout [Integer, nil]
|
|
215
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
216
216
|
# @param proxy [String, nil] Proxy server URI
|
|
217
217
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
218
218
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -246,7 +246,7 @@ unless defined?(Wreq)
|
|
|
246
246
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
247
247
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
248
248
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
249
|
-
# @param read_timeout [Integer, nil]
|
|
249
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
250
250
|
# @param proxy [String, nil] Proxy server URI
|
|
251
251
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
252
252
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -280,7 +280,7 @@ unless defined?(Wreq)
|
|
|
280
280
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
281
281
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
282
282
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
283
|
-
# @param read_timeout [Integer, nil]
|
|
283
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
284
284
|
# @param proxy [String, nil] Proxy server URI
|
|
285
285
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
286
286
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -314,7 +314,7 @@ unless defined?(Wreq)
|
|
|
314
314
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
315
315
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
316
316
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
317
|
-
# @param read_timeout [Integer, nil]
|
|
317
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
318
318
|
# @param proxy [String, nil] Proxy server URI
|
|
319
319
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
320
320
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -348,7 +348,7 @@ unless defined?(Wreq)
|
|
|
348
348
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
349
349
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
350
350
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
351
|
-
# @param read_timeout [Integer, nil]
|
|
351
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
352
352
|
# @param proxy [String, nil] Proxy server URI
|
|
353
353
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
354
354
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/wreq_ruby/client.rb
CHANGED
|
@@ -5,7 +5,7 @@ unless defined?(Wreq)
|
|
|
5
5
|
# HTTP client with extensive configuration options.
|
|
6
6
|
#
|
|
7
7
|
# This class wraps a native Rust implementation providing high-performance
|
|
8
|
-
# HTTP/1.1 and HTTP/
|
|
8
|
+
# HTTP/1.1, HTTP/2 and HTTP/3 client functionality with support for connection pooling,
|
|
9
9
|
# compression, redirects, proxies, and fine-grained timeout controls.
|
|
10
10
|
#
|
|
11
11
|
# The client is thread-safe and maintains an internal connection pool for
|
|
@@ -84,8 +84,8 @@ unless defined?(Wreq)
|
|
|
84
84
|
# from the overall timeout.
|
|
85
85
|
#
|
|
86
86
|
# @param read_timeout [Integer, nil] Maximum time in seconds to wait
|
|
87
|
-
#
|
|
88
|
-
#
|
|
87
|
+
# for response headers or each body chunk. Time spent by the caller
|
|
88
|
+
# between body reads is excluded. Defaults to no read timeout.
|
|
89
89
|
#
|
|
90
90
|
# @param tcp_keepalive [Integer, nil] Time in seconds that a connection
|
|
91
91
|
# must be idle before TCP keepalive probes are sent. Helps detect
|
|
@@ -110,25 +110,37 @@ unless defined?(Wreq)
|
|
|
110
110
|
# allowing the reuse of local addresses in TIME_WAIT state. Useful for
|
|
111
111
|
# reducing port exhaustion in high-throughput scenarios.
|
|
112
112
|
#
|
|
113
|
-
# @param pool_idle_timeout [Integer, nil]
|
|
114
|
-
#
|
|
115
|
-
#
|
|
113
|
+
# @param pool_idle_timeout [Integer, nil] Idle connection reuse timeout in
|
|
114
|
+
# seconds. Defaults to 90 when omitted or nil. Does not expire a busy
|
|
115
|
+
# HTTP/2 or HTTP/3 connection.
|
|
116
116
|
#
|
|
117
|
-
# @param pool_max_idle_per_host [Integer, nil] Maximum
|
|
118
|
-
# connections
|
|
119
|
-
#
|
|
117
|
+
# @param pool_max_idle_per_host [Integer, nil] Maximum idle HTTP/1
|
|
118
|
+
# connections retained per compatibility group, which includes the host
|
|
119
|
+
# and connection configuration. Defaults to unlimited when omitted or
|
|
120
|
+
# nil; 0 disables connection reuse. Does not limit active connections.
|
|
120
121
|
#
|
|
121
|
-
# @param pool_max_size [Integer, nil]
|
|
122
|
-
#
|
|
123
|
-
#
|
|
122
|
+
# @param pool_max_size [Integer, nil] Maximum compatibility groups retaining
|
|
123
|
+
# idle HTTP/1 or shared HTTP/2 and HTTP/3 connections. Defaults to unlimited
|
|
124
|
+
# when omitted, nil or 0. A full pool evicts the least recently used idle
|
|
125
|
+
# group; it does not make requests wait or limit physical connections.
|
|
124
126
|
#
|
|
125
127
|
# @param http1_only [Boolean, nil] Force the client to use HTTP/1.1 only,
|
|
126
128
|
# even if HTTP/2 is available. Useful for compatibility with servers
|
|
127
|
-
# that have problematic HTTP/2 implementations.
|
|
129
|
+
# that have problematic HTTP/2 implementations. Cannot be combined with
|
|
130
|
+
# http2_only or http3_only. An explicit request version overrides this
|
|
131
|
+
# preference.
|
|
128
132
|
#
|
|
129
133
|
# @param http2_only [Boolean, nil] Force the client to use HTTP/2 only.
|
|
130
134
|
# Requests to servers that don't support HTTP/2 will fail. Cannot be
|
|
131
|
-
# combined with http1_only.
|
|
135
|
+
# combined with http1_only or http3_only. An explicit request version
|
|
136
|
+
# overrides this preference, including HTTP/3 over QUIC.
|
|
137
|
+
#
|
|
138
|
+
# @param http3_only [Boolean, nil] Use HTTP/3 over QUIC without falling back
|
|
139
|
+
# to TCP. Defaults to false when omitted or nil. Requires HTTPS and UDP
|
|
140
|
+
# connectivity. Cannot be combined with http1_only or http2_only. An
|
|
141
|
+
# explicit HTTP/1 or HTTP/2 request version overrides this preference.
|
|
142
|
+
# HTTP/HTTPS proxies, including environment proxies, cannot carry HTTP/3;
|
|
143
|
+
# use no_proxy: true, a SOCKS5 UDP proxy, or a QUIC MASQUE proxy instead.
|
|
132
144
|
#
|
|
133
145
|
# @param https_only [Boolean, nil] Reject plain HTTP connections and
|
|
134
146
|
# only allow HTTPS. Provides an additional layer of security by
|
|
@@ -149,7 +161,9 @@ unless defined?(Wreq)
|
|
|
149
161
|
# environment.
|
|
150
162
|
#
|
|
151
163
|
# @param proxy [String, nil] Proxy server URI to use for all requests.
|
|
152
|
-
# Supports HTTP, HTTPS, and
|
|
164
|
+
# Supports HTTP, HTTPS, SOCKS and QUIC proxies. HTTP/3 can use SOCKS5 UDP
|
|
165
|
+
# ASSOCIATE or a `quic://` MASQUE proxy, but not HTTP CONNECT proxies.
|
|
166
|
+
# Format: "protocol://host:port"
|
|
153
167
|
# Example: "http://proxy.example.com:8080"
|
|
154
168
|
# @param local_address [String, nil] Bind the client's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable.
|
|
155
169
|
# @param interface [String, nil] Bind sockets to a network interface on
|
|
@@ -196,7 +210,7 @@ unless defined?(Wreq)
|
|
|
196
210
|
# client = Wreq::Client.new(
|
|
197
211
|
# timeout: 30, # 30 seconds total
|
|
198
212
|
# connect_timeout: 5, # 5 seconds to connect
|
|
199
|
-
# read_timeout: 10 # 10 seconds
|
|
213
|
+
# read_timeout: 10 # 10 seconds for headers or each body read
|
|
200
214
|
# )
|
|
201
215
|
#
|
|
202
216
|
# @example Client with redirect handling
|
|
@@ -280,7 +294,7 @@ unless defined?(Wreq)
|
|
|
280
294
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
281
295
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
282
296
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
283
|
-
# @param read_timeout [Integer, nil]
|
|
297
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
284
298
|
# @param proxy [String, nil] Proxy server URI
|
|
285
299
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
286
300
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -316,7 +330,7 @@ unless defined?(Wreq)
|
|
|
316
330
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
317
331
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
318
332
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
319
|
-
# @param read_timeout [Integer, nil]
|
|
333
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
320
334
|
# @param proxy [String, nil] Proxy server URI
|
|
321
335
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
322
336
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -350,7 +364,7 @@ unless defined?(Wreq)
|
|
|
350
364
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
351
365
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
352
366
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
353
|
-
# @param read_timeout [Integer, nil]
|
|
367
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
354
368
|
# @param proxy [String, nil] Proxy server URI
|
|
355
369
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
356
370
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -384,7 +398,7 @@ unless defined?(Wreq)
|
|
|
384
398
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
385
399
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
386
400
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
387
|
-
# @param read_timeout [Integer, nil]
|
|
401
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
388
402
|
# @param proxy [String, nil] Proxy server URI
|
|
389
403
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
390
404
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -418,7 +432,7 @@ unless defined?(Wreq)
|
|
|
418
432
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
419
433
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
420
434
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
421
|
-
# @param read_timeout [Integer, nil]
|
|
435
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
422
436
|
# @param proxy [String, nil] Proxy server URI
|
|
423
437
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
424
438
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -452,7 +466,7 @@ unless defined?(Wreq)
|
|
|
452
466
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
453
467
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
454
468
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
455
|
-
# @param read_timeout [Integer, nil]
|
|
469
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
456
470
|
# @param proxy [String, nil] Proxy server URI
|
|
457
471
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
458
472
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -486,7 +500,7 @@ unless defined?(Wreq)
|
|
|
486
500
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
487
501
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
488
502
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
489
|
-
# @param read_timeout [Integer, nil]
|
|
503
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
490
504
|
# @param proxy [String, nil] Proxy server URI
|
|
491
505
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
492
506
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -520,7 +534,7 @@ unless defined?(Wreq)
|
|
|
520
534
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
521
535
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
522
536
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
523
|
-
# @param read_timeout [Integer, nil]
|
|
537
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
524
538
|
# @param proxy [String, nil] Proxy server URI
|
|
525
539
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
526
540
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
|
@@ -554,7 +568,7 @@ unless defined?(Wreq)
|
|
|
554
568
|
# @param deflate [Boolean, nil] Enable deflate compression
|
|
555
569
|
# @param zstd [Boolean, nil] Enable Zstandard compression
|
|
556
570
|
# @param timeout [Integer, nil] Total request timeout (seconds)
|
|
557
|
-
# @param read_timeout [Integer, nil]
|
|
571
|
+
# @param read_timeout [Integer, nil] Timeout for headers or each body chunk (seconds)
|
|
558
572
|
# @param proxy [String, nil] Proxy server URI
|
|
559
573
|
# @param local_address [String, nil] Bind the request's local source IP address (IPv4/IPv6). Useful on multi-homed hosts to originate connections from a specific address or enforce source routing. Examples: "192.168.1.10", "10.0.0.5", "2001:db8::1". The address must exist on the host and be routable or the connection may fail.
|
|
560
574
|
# @param interface [String, nil] Bind to an interface on supported platforms; unsupported platforms raise ArgumentError.
|
data/lib/wreq_ruby/emulate.rb
CHANGED
|
@@ -67,6 +67,8 @@ module Wreq
|
|
|
67
67
|
Chrome153 = nil
|
|
68
68
|
Chrome154 = nil
|
|
69
69
|
Chrome155 = nil
|
|
70
|
+
Chrome156 = nil
|
|
71
|
+
Chrome157 = nil
|
|
70
72
|
|
|
71
73
|
Edge101 = nil
|
|
72
74
|
Edge122 = nil
|
|
@@ -265,9 +267,12 @@ module Wreq
|
|
|
265
267
|
# for HTTP/2 and automatic default headers. The actual implementation is
|
|
266
268
|
# provided by Rust.
|
|
267
269
|
#
|
|
270
|
+
# Profiles configure TLS over TCP, HTTP/2 and request headers. They do not
|
|
271
|
+
# configure HTTP/3 or QUIC fingerprints; HTTP/3 uses the backend defaults.
|
|
272
|
+
#
|
|
268
273
|
# Construction generates the native configuration once. For Chrome 152/153,
|
|
269
274
|
# the TLS trust_anchors extension's ID order is randomized at construction;
|
|
270
|
-
# Chrome 154
|
|
275
|
+
# Chrome 154 and later sort those IDs by their raw bytes instead. Reusing this object
|
|
271
276
|
# across clients or requests retains that order. Creating a new object generates
|
|
272
277
|
# a new configuration, including a fresh shuffle for Chrome 152/153.
|
|
273
278
|
# This does not freeze other per-handshake randomness or force a new handshake
|
|
@@ -299,7 +304,7 @@ module Wreq
|
|
|
299
304
|
# This stub is for documentation only.
|
|
300
305
|
unless singleton_methods(false).include?(:new)
|
|
301
306
|
# Generates a reusable native configuration. Chrome 152/153 Trust Anchor ID
|
|
302
|
-
# order is chosen here and retained when this object is reused; Chrome 154
|
|
307
|
+
# order is chosen here and retained when this object is reused; Chrome 154–156
|
|
303
308
|
# use raw-byte sorted order. See {Emulation} for connection semantics.
|
|
304
309
|
#
|
|
305
310
|
# @param profile [Wreq::Profile, nil] Fingerprint profile to emulate
|
data/lib/wreq_ruby/http.rb
CHANGED
|
@@ -42,7 +42,7 @@ module Wreq
|
|
|
42
42
|
|
|
43
43
|
# Value-based equality. Returns true when both represent the same HTTP method.
|
|
44
44
|
# @param other [Object]
|
|
45
|
-
# @return [Boolean]
|
|
45
|
+
# @return [Boolean]
|
|
46
46
|
unless method_defined?(:==)
|
|
47
47
|
def ==(other)
|
|
48
48
|
end
|
|
@@ -77,7 +77,14 @@ module Wreq
|
|
|
77
77
|
HTTP_10 = nil # @return [Wreq::Version] HTTP/1.0
|
|
78
78
|
HTTP_11 = nil # @return [Wreq::Version] HTTP/1.1
|
|
79
79
|
HTTP_2 = nil # @return [Wreq::Version] HTTP/2
|
|
80
|
-
|
|
80
|
+
# Select HTTP/3 over QUIC with `version: Wreq::Version::HTTP_3` on a request.
|
|
81
|
+
# To use it by default, construct a client with `http3_only: true` instead.
|
|
82
|
+
# Requires an HTTPS URL and a reachable UDP endpoint. There is no automatic
|
|
83
|
+
# Alt-Svc discovery or fallback to HTTP/1.1 or HTTP/2.
|
|
84
|
+
# HTTP CONNECT proxies cannot carry these requests; use a direct connection,
|
|
85
|
+
# a SOCKS5 UDP relay or a `quic://` MASQUE proxy.
|
|
86
|
+
# @return [Wreq::Version] HTTP/3
|
|
87
|
+
HTTP_3 = nil
|
|
81
88
|
end
|
|
82
89
|
|
|
83
90
|
# Returns a string representation of the HTTP version.
|
data/test/emulation_test.rb
CHANGED
|
@@ -7,7 +7,7 @@ require "timeout"
|
|
|
7
7
|
|
|
8
8
|
class EmulationTest < Minitest::Test
|
|
9
9
|
def test_reused_emulation_retains_trust_anchors_across_clients_and_requests
|
|
10
|
-
[Wreq::Profile::Chrome152, Wreq::Profile::Chrome153, Wreq::Profile::Chrome154, Wreq::Profile::Chrome155].each do |profile|
|
|
10
|
+
[Wreq::Profile::Chrome152, Wreq::Profile::Chrome153, Wreq::Profile::Chrome154, Wreq::Profile::Chrome155, Wreq::Profile::Chrome156, Wreq::Profile::Chrome157].each do |profile|
|
|
11
11
|
emulation = Wreq::Emulation.new(profile: profile)
|
|
12
12
|
client = Wreq::Client.new(emulation: emulation, no_proxy: true)
|
|
13
13
|
expected = capture_trust_anchors { |url| client.get(url, timeout: 5) }
|
|
@@ -44,6 +44,8 @@ class EmulationTest < Minitest::Test
|
|
|
44
44
|
Wreq::Profile::Chrome153 => "Chrome153",
|
|
45
45
|
Wreq::Profile::Chrome154 => "Chrome154",
|
|
46
46
|
Wreq::Profile::Chrome155 => "Chrome155",
|
|
47
|
+
Wreq::Profile::Chrome156 => "Chrome156",
|
|
48
|
+
Wreq::Profile::Chrome157 => "Chrome157",
|
|
47
49
|
Wreq::Profile::Firefox152 => "Firefox152"
|
|
48
50
|
}.each do |profile, name|
|
|
49
51
|
assert_equal name, profile.to_s
|
|
@@ -227,12 +227,21 @@ class OptionValidationTest < Minitest::Test
|
|
|
227
227
|
end
|
|
228
228
|
|
|
229
229
|
def test_protocol_only_options_are_mutually_exclusive
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
[:http1_only, :http2_only, :http3_only].combination(2) do |first, second|
|
|
231
|
+
error = assert_raises(ArgumentError) do
|
|
232
|
+
Wreq::Client.new(**{first => true, second => true})
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
assert_includes error.message, ":#{first}"
|
|
236
|
+
assert_includes error.message, ":#{second}"
|
|
232
237
|
end
|
|
233
238
|
|
|
234
|
-
|
|
235
|
-
|
|
239
|
+
assert_instance_of Wreq::Client,
|
|
240
|
+
Wreq::Client.new(http3_only: true, http1_only: false, http2_only: nil)
|
|
241
|
+
assert_instance_of Wreq::Client,
|
|
242
|
+
Wreq::Client.new(http1_only: true, http3_only: false)
|
|
243
|
+
assert_instance_of Wreq::Client,
|
|
244
|
+
Wreq::Client.new(http2_only: true, http3_only: nil)
|
|
236
245
|
end
|
|
237
246
|
|
|
238
247
|
def test_validation_reports_the_first_failed_rule
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wreq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.3
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- SearchApi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10
|
|
11
|
+
date: 2026-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: An easy and powerful Ruby HTTP client with advanced browser fingerprinting
|
|
14
14
|
that accurately emulates Chrome, Edge, Firefox, Safari, Opera, and OkHttp with precise
|