rnet 3.0.0rc5__cp311-abi3-manylinux_2_34_armv7l.whl → 3.0.0rc7__cp311-abi3-manylinux_2_34_armv7l.whl

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.

Potentially problematic release.


This version of rnet might be problematic. Click here for more details.

rnet/tls.py CHANGED
@@ -8,9 +8,20 @@ These types are typically used to configure client-side TLS authentication and c
8
8
 
9
9
  from enum import Enum, auto
10
10
  from pathlib import Path
11
- from typing import List
12
-
13
- __all__ = ["TlsVersion", "Identity", "CertStore", "KeyLogPolicy"]
11
+ from typing import List, NotRequired, TypedDict, Unpack
12
+
13
+ __all__ = [
14
+ "TlsVersion",
15
+ "Identity",
16
+ "CertStore",
17
+ "KeyLog",
18
+ "AlpnProtocol",
19
+ "AlpsProtocol",
20
+ "CertificateCompressionAlgorithm",
21
+ "ExtensionType",
22
+ "TlsOptions",
23
+ "Params",
24
+ ]
14
25
 
15
26
 
16
27
  class TlsVersion(Enum):
@@ -24,6 +35,74 @@ class TlsVersion(Enum):
24
35
  TLS_1_3 = auto()
25
36
 
26
37
 
38
+ class AlpnProtocol(Enum):
39
+ """
40
+ A TLS ALPN protocol.
41
+ """
42
+
43
+ HTTP1 = auto()
44
+ HTTP2 = auto()
45
+ HTTP3 = auto()
46
+
47
+
48
+ class AlpsProtocol(Enum):
49
+ """
50
+ Application-layer protocol settings for HTTP/1.1 and HTTP/2.
51
+ """
52
+
53
+ HTTP1 = auto()
54
+ HTTP2 = auto()
55
+ HTTP3 = auto()
56
+
57
+
58
+ class CertificateCompressionAlgorithm(Enum):
59
+ """
60
+ IANA assigned identifier of compression algorithm.
61
+ See https://www.rfc-editor.org/rfc/rfc8879.html#name-compression-algorithms
62
+ """
63
+
64
+ ZLIB = auto()
65
+ BROTLI = auto()
66
+ ZSTD = auto()
67
+
68
+
69
+ class ExtensionType(Enum):
70
+ """
71
+ A TLS extension type.
72
+ """
73
+
74
+ SERVER_NAME = auto()
75
+ STATUS_REQUEST = auto()
76
+ EC_POINT_FORMATS = auto()
77
+ SIGNATURE_ALGORITHMS = auto()
78
+ SRTP = auto()
79
+ APPLICATION_LAYER_PROTOCOL_NEGOTIATION = auto()
80
+ PADDING = auto()
81
+ EXTENDED_MASTER_SECRET = auto()
82
+ QUIC_TRANSPORT_PARAMETERS_LEGACY = auto()
83
+ QUIC_TRANSPORT_PARAMETERS_STANDARD = auto()
84
+ CERT_COMPRESSION = auto()
85
+ SESSION_TICKET = auto()
86
+ SUPPORTED_GROUPS = auto()
87
+ PRE_SHARED_KEY = auto()
88
+ EARLY_DATA = auto()
89
+ SUPPORTED_VERSIONS = auto()
90
+ COOKIE = auto()
91
+ PSK_KEY_EXCHANGE_MODES = auto()
92
+ CERTIFICATE_AUTHORITIES = auto()
93
+ SIGNATURE_ALGORITHMS_CERT = auto()
94
+ KEY_SHARE = auto()
95
+ RENEGOTIATE = auto()
96
+ DELEGATED_CREDENTIAL = auto()
97
+ APPLICATION_SETTINGS = auto()
98
+ APPLICATION_SETTINGS_NEW = auto()
99
+ ENCRYPTED_CLIENT_HELLO = auto()
100
+ CERTIFICATE_TIMESTAMP = auto()
101
+ NEXT_PROTO_NEG = auto()
102
+ CHANNEL_ID = auto()
103
+ RECORD_SIZE_LIMIT = auto()
104
+
105
+
27
106
  class Identity:
28
107
  """
29
108
  Represents a private key and X509 cert as a client certificate.
@@ -111,7 +190,7 @@ class CertStore:
111
190
  ...
112
191
 
113
192
 
114
- class KeyLogPolicy:
193
+ class KeyLog:
115
194
  """
116
195
  Specifies the intent for a (TLS) keylogger to be used in a client or server configuration.
117
196
 
@@ -121,9 +200,9 @@ class KeyLogPolicy:
121
200
  with the correct session keys.
122
201
 
123
202
  Static Methods:
124
- environment() -> KeyLogPolicy
203
+ environment() -> KeyLog
125
204
  Use the SSLKEYLOGFILE environment variable for key logging.
126
- file(path: Path) -> KeyLogPolicy
205
+ file(path: Path) -> KeyLog
127
206
  Log keys to the specified file path.
128
207
 
129
208
  Methods:
@@ -134,14 +213,14 @@ class KeyLogPolicy:
134
213
  """
135
214
 
136
215
  @staticmethod
137
- def environment() -> "KeyLogPolicy":
216
+ def environment() -> "KeyLog":
138
217
  """
139
218
  Use the SSLKEYLOGFILE environment variable for key logging.
140
219
  """
141
220
  ...
142
221
 
143
222
  @staticmethod
144
- def file(path: Path) -> "KeyLogPolicy":
223
+ def file(path: Path) -> "KeyLog":
145
224
  """
146
225
  Log keys to the specified file path.
147
226
 
@@ -150,14 +229,191 @@ class KeyLogPolicy:
150
229
  """
151
230
  ...
152
231
 
153
- def is_environment(self) -> bool:
154
- """
155
- Returns True if this policy uses the environment variable.
156
- """
157
- ...
158
232
 
159
- def is_file(self) -> bool:
233
+ class Params(TypedDict):
234
+ """
235
+ All parameters for TLS connections.
236
+ """
237
+
238
+ alpn_protocols: NotRequired[List[AlpnProtocol]]
239
+ """
240
+ Application-Layer Protocol Negotiation (RFC 7301).
241
+
242
+ Specifies which application protocols (e.g., HTTP/2, HTTP/1.1) may be negotiated
243
+ over a single TLS connection.
244
+ """
245
+
246
+ alps_protocols: NotRequired[List[AlpsProtocol]]
247
+ """
248
+ Application-Layer Protocol Settings (ALPS).
249
+
250
+ Enables exchanging application-layer settings during the handshake
251
+ for protocols negotiated via ALPN.
252
+ """
253
+
254
+ alps_use_new_codepoint: NotRequired[bool]
255
+ """
256
+ Whether to use an alternative ALPS codepoint for compatibility.
257
+
258
+ Useful when larger ALPS payloads are required.
259
+ """
260
+
261
+ session_ticket: NotRequired[bool]
262
+ """
263
+ Enables TLS Session Tickets (RFC 5077).
264
+
265
+ Allows session resumption without requiring server-side state.
266
+ """
267
+
268
+ min_tls_version: NotRequired[TlsVersion]
269
+ """
270
+ Minimum TLS version allowed for the connection.
271
+ """
272
+
273
+ max_tls_version: NotRequired[TlsVersion]
274
+ """
275
+ Maximum TLS version allowed for the connection.
276
+ """
277
+
278
+ pre_shared_key: NotRequired[bool]
279
+ """
280
+ Enables Pre-Shared Key (PSK) cipher suites (RFC 4279).
281
+
282
+ Authentication relies on out-of-band pre-shared keys instead of certificates.
283
+ """
284
+
285
+ enable_ech_grease: NotRequired[bool]
286
+ """
287
+ Controls whether to send a GREASE Encrypted ClientHello (ECH) extension
288
+ when no supported ECH configuration is available.
289
+
290
+ GREASE prevents protocol ossification by sending unknown extensions.
291
+ """
292
+
293
+ permute_extensions: NotRequired[bool]
294
+ """
295
+ Controls whether ClientHello extensions should be permuted.
296
+ """
297
+
298
+ grease_enabled: NotRequired[bool]
299
+ """
300
+ Controls whether GREASE extensions (RFC 8701) are enabled in general.
301
+ """
302
+
303
+ enable_ocsp_stapling: NotRequired[bool]
304
+ """
305
+ Enables OCSP stapling for the connection.
306
+ """
307
+
308
+ enable_signed_cert_timestamps: NotRequired[bool]
309
+ """
310
+ Enables Signed Certificate Timestamps (SCT).
311
+ """
312
+
313
+ record_size_limit: NotRequired[int]
314
+ """
315
+ Sets the maximum TLS record size.
316
+ """
317
+
318
+ psk_skip_session_ticket: NotRequired[bool]
319
+ """
320
+ Whether to skip session tickets when using PSK.
321
+ """
322
+
323
+ key_shares_limit: NotRequired[int]
324
+ """
325
+ Maximum number of key shares to include in ClientHello.
326
+ """
327
+
328
+ psk_dhe_ke: NotRequired[bool]
329
+ """
330
+ Enables PSK with (EC)DHE key establishment (`psk_dhe_ke`).
331
+ """
332
+
333
+ renegotiation: NotRequired[bool]
334
+ """
335
+ Enables TLS renegotiation by sending the `renegotiation_info` extension.
336
+ """
337
+
338
+ delegated_credentials: NotRequired[str]
339
+ """
340
+ Delegated Credentials (RFC 9345).
341
+
342
+ Allows TLS 1.3 endpoints to use temporary delegated credentials
343
+ for authentication with reduced long-term key exposure.
344
+ """
345
+
346
+ curves_list: NotRequired[str]
347
+ """
348
+ List of supported elliptic curves.
349
+ """
350
+
351
+ cipher_list: NotRequired[str]
352
+ """
353
+ Cipher suite configuration string.
354
+
355
+ Uses BoringSSL's mini-language to select, enable, and prioritize ciphers.
356
+ """
357
+
358
+ sigalgs_list: NotRequired[str]
359
+ """
360
+ List of supported signature algorithms.
361
+ """
362
+
363
+ certificate_compression_algorithms: NotRequired[
364
+ List[CertificateCompressionAlgorithm]
365
+ ]
366
+ """
367
+ Supported certificate compression algorithms (RFC 8879).
368
+ """
369
+
370
+ extension_permutation: NotRequired[List[ExtensionType]]
371
+ """
372
+ Supported TLS extensions, used for extension ordering/permutation.
373
+ """
374
+
375
+ aes_hw_override: NotRequired[bool]
376
+ """
377
+ Overrides AES hardware acceleration.
378
+ """
379
+
380
+ preserve_tls13_cipher_list: NotRequired[bool]
381
+ """
382
+ Sets whether to preserve the TLS 1.3 cipher list as configured by cipher_list.
383
+
384
+ By default, BoringSSL does not preserve the TLS 1.3 cipher list. When this option is disabled
385
+ (the default), BoringSSL uses its internal default TLS 1.3 cipher suites in its default order,
386
+ regardless of what is set via cipher_list.
387
+
388
+ When enabled, this option ensures that the TLS 1.3 cipher suites explicitly set via
389
+ cipher_list are retained in their original order, without being reordered or
390
+ modified by BoringSSL's internal logic. This is useful for maintaining specific cipher suite
391
+ priorities for TLS 1.3. Note that if cipher_list does not include any TLS 1.3
392
+ cipher suites, BoringSSL will still fall back to its default TLS 1.3 cipher suites and order.
393
+ """
394
+
395
+ random_aes_hw_override: NotRequired[bool]
396
+ """
397
+ Overrides the random AES hardware acceleration.
398
+ """
399
+
400
+
401
+ class TlsOptions:
402
+ """
403
+ TLS connection configuration options.
404
+
405
+ This struct provides fine-grained control over the behavior of TLS
406
+ connections, including:
407
+ - **Protocol negotiation** (ALPN, ALPS, TLS versions)
408
+ - **Session management** (tickets, PSK, key shares)
409
+ - **Security & privacy** (OCSP, GREASE, ECH, delegated credentials)
410
+ - **Performance tuning** (record size, cipher preferences, hardware overrides)
411
+
412
+ All fields are optional or have defaults. See each field for details.
413
+ """
414
+
415
+ def __init__(self, **kwargs: Unpack[Params]) -> None:
160
416
  """
161
- Returns True if this policy logs to a specific file.
417
+ Creates a new TlsOptions.
162
418
  """
163
419
  ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rnet
3
- Version: 3.0.0rc5
3
+ Version: 3.0.0rc7
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -44,13 +44,12 @@ A blazing-fast Python HTTP client with advanced browser fingerprinting that accu
44
44
  - Plain bodies, JSON, urlencoded, multipart
45
45
  - Cookie Store
46
46
  - Redirect Policy
47
- - Original Header
47
+ - Original Headers
48
48
  - Rotating Proxies
49
+ - WebSocket Upgrade
49
50
  - Connection Pooling
50
51
  - Streaming Transfers
51
52
  - Zero-Copy Transfers
52
- - WebSocket Upgrade
53
- - Async DNS Resolver
54
53
  - HTTPS via BoringSSL
55
54
  - Free-Threaded Safety
56
55
  - Automatic Decompression
@@ -60,14 +59,14 @@ A blazing-fast Python HTTP client with advanced browser fingerprinting that accu
60
59
  The following example uses the `asyncio` runtime with `rnet` installed via pip:
61
60
 
62
61
  ```bash
63
- pip install asyncio rnet==3.0.0rc5
62
+ pip install asyncio rnet==3.0.0rc7
64
63
  ```
65
64
 
66
65
  And then the code:
67
66
 
68
67
  ```python
69
68
  import asyncio
70
- from rnet import Emulation, Client
69
+ from rnet import Client, Emulation
71
70
 
72
71
 
73
72
  async def main():
@@ -110,9 +109,9 @@ Additional learning resources include:
110
109
 
111
110
  | **Browser** | **Versions** |
112
111
  | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
113
- | **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` |
114
- | **Safari** | `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos16_5`, `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari18`, `SafariIPad18`, `Safari18_2`, `SafariIos18_1_1`, `Safari18_3`, `Safari18_3_1`, `Safari18_5` |
115
- | **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139` |
112
+ | **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` |
113
+ | **Safari** | `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos16_5`, `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari18`, `SafariIPad18`, `Safari18_2`, `SafariIos18_1_1`, `Safari18_3`, `Safari18_3_1`, `Safari18_5`, `Safari26`, `SafariIos26`, `SafariIPad26` |
114
+ | **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139`, `Firefox142`, `Firefox143` |
116
115
  | **OkHttp** | `OkHttp3_9`, `OkHttp3_11`, `OkHttp3_13`, `OkHttp3_14`, `OkHttp4_9`, `OkHttp4_10`, `OkHttp4_12`, `OkHttp5` |
117
116
  | **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134` |
118
117
  | **Opera** | `Opera116`, `Opera117`, `Opera118`, `Opera119` |
@@ -168,6 +167,10 @@ bash .github/musl_build.sh armv7-unknown-linux-musleabihf
168
167
 
169
168
  For Manylinux compilation, refer to [manylinux](https://github.com/PyO3/maturin?tab=readme-ov-file#manylinux-and-auditwheel).
170
169
 
170
+ ## Services
171
+
172
+ Help sustain the ongoing development of this open-source project by reaching out for [commercial support](mailto:gngppz@gmail.com). Receive private guidance, expert reviews, or direct access to the maintainer, with personalized technical assistance tailored to your needs.
173
+
171
174
  ## Benchmark
172
175
 
173
176
  Outperforms `requests`, `httpx`, `Python-TLS-Client`, and `curl_cffi`. See the [benchmark](https://github.com/0x676e67/rnet/tree/main/python/benchmark) for details. Benchmark data is for reference only—actual performance may vary based on your environment and use case.
@@ -180,9 +183,3 @@ Licensed under either of Apache License, Version 2.0 ([LICENSE](./LICENSE) or ht
180
183
 
181
184
  Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the [Apache-2.0](./LICENSE) license, shall be licensed as above, without any additional terms or conditions.
182
185
 
183
- ## Sponsors
184
-
185
- <a href="https://dashboard.capsolver.com/passport/register?inviteCode=y7CtB_a-3X6d" target="_blank"><img src="https://raw.githubusercontent.com/0x676e67/rnet/main/.github/assets/capsolver.jpg" height="47" width="149"></a>
186
-
187
- [CapSolver](https://www.capsolver.com/?utm_source=github&utm_medium=banner_repo&utm_campaign=rnet) leverages AI-powered Auto Web Unblock to bypass Captchas effortlessly, providing fast, reliable, and cost-effective data access with seamless integration into Colly, Puppeteer, and Playwright—use code **`RNET`** for a 6% bonus!
188
-
@@ -0,0 +1,16 @@
1
+ rnet-3.0.0rc7.dist-info/METADATA,sha256=0m7YqcLSDD-GiLFSElCvu8wofAZ1fLWZRn9pCgSGl4A,9979
2
+ rnet-3.0.0rc7.dist-info/WHEEL,sha256=ZFr8mxu3QWGRXWbaefsVO5rgCUeGbKk6OWT1EhuCKK4,107
3
+ rnet-3.0.0rc7.dist-info/licenses/LICENSE,sha256=ld2UNRYADDwfLyJ9Q34VP3bWRfS53mvK1tixHd57kN0,11357
4
+ rnet/__init__.py,sha256=IqBAlAtFivJ1usxz9uVBXN1ozDd8O-o4oLEcJHNILmM,385
5
+ rnet/__init__.pyi,sha256=3Mov6pgqf7kqn7m739vzgVGXrWPBLhe0VF5H9Swodlw,33420
6
+ rnet/blocking.py,sha256=W2tTSUH1y8MVNKnFY1Zdran36hMT8Qj9rosWVyGIgBE,8747
7
+ rnet/cookie.py,sha256=4UYJY9jlXqe8vObXLSqzk1dFoKRO5mCnsgC0TCC4N1Y,3023
8
+ rnet/emulation.py,sha256=gcpJetO35t5-EmzJA6-QUuERV9beo7G2E0ybgmtQXxY,5224
9
+ rnet/exceptions.py,sha256=Rpwo1GVE2eJhFVAGJWAlsY4XypZ-i0j9Th-pnm7l_yY,5951
10
+ rnet/header.py,sha256=K_bp5F_4D21UjMaBp7aM-aGVYI162IsX-vn2fjExEF4,9749
11
+ rnet/http1.py,sha256=CHxz8Ns3Pr_VFl9iQdi9PlnF3IgmNiv2biolSZVl9fU,1497
12
+ rnet/http2.py,sha256=C3ClzUdi99KVKGFezavi77AFvotWyDBzMEj2XeQDyUI,9127
13
+ rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ rnet/rnet.abi3.so,sha256=-HyOFOZc0dJkInHa3B-QYhGCCVVEgpHfJ4k9FO9dRhg,7378776
15
+ rnet/tls.py,sha256=LioQPDAPHbWJQOvMdm2tfpAxmFUVP4Qe73_kUoIgmlI,11565
16
+ rnet-3.0.0rc7.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- rnet-3.0.0rc5.dist-info/METADATA,sha256=bp8ICFMAga2eIDMrjPG9EqUn-bBnSSg3bbwoyJ6PZGU,10167
2
- rnet-3.0.0rc5.dist-info/WHEEL,sha256=ZFr8mxu3QWGRXWbaefsVO5rgCUeGbKk6OWT1EhuCKK4,107
3
- rnet-3.0.0rc5.dist-info/licenses/LICENSE,sha256=ld2UNRYADDwfLyJ9Q34VP3bWRfS53mvK1tixHd57kN0,11357
4
- rnet/__init__.py,sha256=-ls4I6NTnLT8vB8ST0KgphHliSJ8c_NyhrVzBa5JMJ0,277
5
- rnet/__init__.pyi,sha256=agbHpzttbVqUvdL5tgeEriT2BwC1ugUbNBJO0cxapmI,32430
6
- rnet/blocking.py,sha256=SBmDK2L-hHucROnBQrX71oggOyftEw144j9Q1ee7DXc,8608
7
- rnet/cookie.py,sha256=4UYJY9jlXqe8vObXLSqzk1dFoKRO5mCnsgC0TCC4N1Y,3023
8
- rnet/emulation.py,sha256=JWLvOAtvFa_xkozDinU83BFYW7G8KuEyGVDiaqjqVmQ,5064
9
- rnet/exceptions.py,sha256=A-3i9K-Ek4KRTap2gAI8Z7-ZMjbsOgKCikT3xWSralc,5854
10
- rnet/header.py,sha256=K_bp5F_4D21UjMaBp7aM-aGVYI162IsX-vn2fjExEF4,9749
11
- rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- rnet/rnet.abi3.so,sha256=1pbFEITWL_cQW4iGYSjvwRv8DT7CWq3EivNNkEqlBgE,7299996
13
- rnet/tls.py,sha256=xTTuk3XSReGvzrTvBLyepWm3wq-bHYW-tetsX66Na3g,4853
14
- rnet-3.0.0rc5.dist-info/RECORD,,