primp 1.2.0__tar.gz → 1.2.2__tar.gz
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.
- {primp-1.2.0 → primp-1.2.2}/Cargo.lock +77 -79
- {primp-1.2.0 → primp-1.2.2}/Cargo.toml +1 -1
- {primp-1.2.0 → primp-1.2.2}/PKG-INFO +1 -1
- {primp-1.2.0 → primp-1.2.2}/crates/primp/Cargo.toml +1 -2
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/lib.rs +34 -28
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/Cargo.toml +1 -1
- primp-1.2.2/crates/primp-python/benchmark/benchmark.jpg +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/benchmark.py +30 -19
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/run.py +34 -27
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/server.py +19 -15
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/async_client.md +4 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/client.md +9 -4
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/response.md +4 -16
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/async_usage.py +1 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/authentication.py +2 -8
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/basic_usage.py +20 -4
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/cookies.py +9 -8
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/error_handling.py +7 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/post_requests.py +6 -8
- primp-1.2.2/crates/primp-python/primp.pyi +831 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/async/client.rs +117 -23
- primp-1.2.2/crates/primp-python/src/async/mod.rs +5 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/async/response.rs +82 -125
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/client_builder.rs +12 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/lib.rs +236 -54
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/response.rs +113 -194
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/server.py +42 -11
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_client.py +279 -3
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_exceptions.py +26 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_http_methods.py +132 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_request_params.py +171 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_response.py +21 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_streaming.py +312 -0
- primp-1.2.0/crates/primp-python/benchmark/benchmark.jpg +0 -0
- primp-1.2.0/crates/primp-python/primp.pyi +0 -1031
- primp-1.2.0/crates/primp-python/src/async/mod.rs +0 -7
- {primp-1.2.0 → primp-1.2.2}/README.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/LICENSE-MIT +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/README.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/chrome/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/edge/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/firefox/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/opera/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/safari/mod.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/.gitignore +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/README.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/README.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/requirements.txt +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/exceptions.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/impersonate.md +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/html_conversion.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/proxy.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/streaming.py +1 -1
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/py.typed +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/error.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/impersonate.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/traits.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/utils.rs +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/__init__.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/conftest.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_header_order.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_impersonate.py +0 -0
- {primp-1.2.0 → primp-1.2.2}/pyproject.toml +0 -0
|
@@ -152,9 +152,9 @@ dependencies = [
|
|
|
152
152
|
|
|
153
153
|
[[package]]
|
|
154
154
|
name = "aws-lc-sys"
|
|
155
|
-
version = "0.39.
|
|
155
|
+
version = "0.39.1"
|
|
156
156
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
157
|
-
checksum = "
|
|
157
|
+
checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399"
|
|
158
158
|
dependencies = [
|
|
159
159
|
"cc",
|
|
160
160
|
"cmake",
|
|
@@ -221,9 +221,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
|
|
|
221
221
|
|
|
222
222
|
[[package]]
|
|
223
223
|
name = "cc"
|
|
224
|
-
version = "1.2.
|
|
224
|
+
version = "1.2.58"
|
|
225
225
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
226
|
-
checksum = "
|
|
226
|
+
checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1"
|
|
227
227
|
dependencies = [
|
|
228
228
|
"find-msvc-tools",
|
|
229
229
|
"jobserver",
|
|
@@ -1229,9 +1229,9 @@ dependencies = [
|
|
|
1229
1229
|
|
|
1230
1230
|
[[package]]
|
|
1231
1231
|
name = "indexmap"
|
|
1232
|
-
version = "2.13.
|
|
1232
|
+
version = "2.13.1"
|
|
1233
1233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1234
|
-
checksum = "
|
|
1234
|
+
checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff"
|
|
1235
1235
|
dependencies = [
|
|
1236
1236
|
"equivalent",
|
|
1237
1237
|
"hashbrown 0.16.1",
|
|
@@ -1241,9 +1241,9 @@ dependencies = [
|
|
|
1241
1241
|
|
|
1242
1242
|
[[package]]
|
|
1243
1243
|
name = "inventory"
|
|
1244
|
-
version = "0.3.
|
|
1244
|
+
version = "0.3.24"
|
|
1245
1245
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1246
|
-
checksum = "
|
|
1246
|
+
checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b"
|
|
1247
1247
|
dependencies = [
|
|
1248
1248
|
"rustversion",
|
|
1249
1249
|
]
|
|
@@ -1278,9 +1278,9 @@ dependencies = [
|
|
|
1278
1278
|
|
|
1279
1279
|
[[package]]
|
|
1280
1280
|
name = "iri-string"
|
|
1281
|
-
version = "0.7.
|
|
1281
|
+
version = "0.7.12"
|
|
1282
1282
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1283
|
-
checksum = "
|
|
1283
|
+
checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20"
|
|
1284
1284
|
dependencies = [
|
|
1285
1285
|
"memchr",
|
|
1286
1286
|
"serde",
|
|
@@ -1324,10 +1324,12 @@ dependencies = [
|
|
|
1324
1324
|
|
|
1325
1325
|
[[package]]
|
|
1326
1326
|
name = "js-sys"
|
|
1327
|
-
version = "0.3.
|
|
1327
|
+
version = "0.3.94"
|
|
1328
1328
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1329
|
-
checksum = "
|
|
1329
|
+
checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
|
|
1330
1330
|
dependencies = [
|
|
1331
|
+
"cfg-if",
|
|
1332
|
+
"futures-util",
|
|
1331
1333
|
"once_cell",
|
|
1332
1334
|
"wasm-bindgen",
|
|
1333
1335
|
]
|
|
@@ -1346,9 +1348,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
|
|
|
1346
1348
|
|
|
1347
1349
|
[[package]]
|
|
1348
1350
|
name = "libc"
|
|
1349
|
-
version = "0.2.
|
|
1351
|
+
version = "0.2.184"
|
|
1350
1352
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1351
|
-
checksum = "
|
|
1353
|
+
checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
|
|
1352
1354
|
|
|
1353
1355
|
[[package]]
|
|
1354
1356
|
name = "libm"
|
|
@@ -1364,9 +1366,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
|
|
|
1364
1366
|
|
|
1365
1367
|
[[package]]
|
|
1366
1368
|
name = "litemap"
|
|
1367
|
-
version = "0.8.
|
|
1369
|
+
version = "0.8.2"
|
|
1368
1370
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1369
|
-
checksum = "
|
|
1371
|
+
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
1370
1372
|
|
|
1371
1373
|
[[package]]
|
|
1372
1374
|
name = "litrs"
|
|
@@ -1472,9 +1474,9 @@ dependencies = [
|
|
|
1472
1474
|
|
|
1473
1475
|
[[package]]
|
|
1474
1476
|
name = "mio"
|
|
1475
|
-
version = "1.
|
|
1477
|
+
version = "1.2.0"
|
|
1476
1478
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1477
|
-
checksum = "
|
|
1479
|
+
checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
|
|
1478
1480
|
dependencies = [
|
|
1479
1481
|
"libc",
|
|
1480
1482
|
"wasi",
|
|
@@ -1860,9 +1862,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
|
1860
1862
|
|
|
1861
1863
|
[[package]]
|
|
1862
1864
|
name = "potential_utf"
|
|
1863
|
-
version = "0.1.
|
|
1865
|
+
version = "0.1.5"
|
|
1864
1866
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1865
|
-
checksum = "
|
|
1867
|
+
checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
|
|
1866
1868
|
dependencies = [
|
|
1867
1869
|
"zerovec",
|
|
1868
1870
|
]
|
|
@@ -1910,7 +1912,7 @@ dependencies = [
|
|
|
1910
1912
|
|
|
1911
1913
|
[[package]]
|
|
1912
1914
|
name = "primp"
|
|
1913
|
-
version = "1.2.
|
|
1915
|
+
version = "1.2.2"
|
|
1914
1916
|
dependencies = [
|
|
1915
1917
|
"criterion",
|
|
1916
1918
|
"h2",
|
|
@@ -1922,12 +1924,11 @@ dependencies = [
|
|
|
1922
1924
|
"serde_json",
|
|
1923
1925
|
"tokio",
|
|
1924
1926
|
"url",
|
|
1925
|
-
"webpki-roots",
|
|
1926
1927
|
]
|
|
1927
1928
|
|
|
1928
1929
|
[[package]]
|
|
1929
1930
|
name = "primp-python"
|
|
1930
|
-
version = "1.2.
|
|
1931
|
+
version = "1.2.2"
|
|
1931
1932
|
dependencies = [
|
|
1932
1933
|
"anyhow",
|
|
1933
1934
|
"bytes",
|
|
@@ -1981,9 +1982,9 @@ dependencies = [
|
|
|
1981
1982
|
|
|
1982
1983
|
[[package]]
|
|
1983
1984
|
name = "pyo3"
|
|
1984
|
-
version = "0.28.
|
|
1985
|
+
version = "0.28.3"
|
|
1985
1986
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1986
|
-
checksum = "
|
|
1987
|
+
checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
|
|
1987
1988
|
dependencies = [
|
|
1988
1989
|
"anyhow",
|
|
1989
1990
|
"indexmap",
|
|
@@ -2012,18 +2013,18 @@ dependencies = [
|
|
|
2012
2013
|
|
|
2013
2014
|
[[package]]
|
|
2014
2015
|
name = "pyo3-build-config"
|
|
2015
|
-
version = "0.28.
|
|
2016
|
+
version = "0.28.3"
|
|
2016
2017
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2017
|
-
checksum = "
|
|
2018
|
+
checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
|
|
2018
2019
|
dependencies = [
|
|
2019
2020
|
"target-lexicon",
|
|
2020
2021
|
]
|
|
2021
2022
|
|
|
2022
2023
|
[[package]]
|
|
2023
2024
|
name = "pyo3-ffi"
|
|
2024
|
-
version = "0.28.
|
|
2025
|
+
version = "0.28.3"
|
|
2025
2026
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2026
|
-
checksum = "
|
|
2027
|
+
checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
|
|
2027
2028
|
dependencies = [
|
|
2028
2029
|
"libc",
|
|
2029
2030
|
"pyo3-build-config",
|
|
@@ -2042,9 +2043,9 @@ dependencies = [
|
|
|
2042
2043
|
|
|
2043
2044
|
[[package]]
|
|
2044
2045
|
name = "pyo3-macros"
|
|
2045
|
-
version = "0.28.
|
|
2046
|
+
version = "0.28.3"
|
|
2046
2047
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2047
|
-
checksum = "
|
|
2048
|
+
checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
|
|
2048
2049
|
dependencies = [
|
|
2049
2050
|
"proc-macro2",
|
|
2050
2051
|
"pyo3-macros-backend",
|
|
@@ -2054,9 +2055,9 @@ dependencies = [
|
|
|
2054
2055
|
|
|
2055
2056
|
[[package]]
|
|
2056
2057
|
name = "pyo3-macros-backend"
|
|
2057
|
-
version = "0.28.
|
|
2058
|
+
version = "0.28.3"
|
|
2058
2059
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2059
|
-
checksum = "
|
|
2060
|
+
checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
|
|
2060
2061
|
dependencies = [
|
|
2061
2062
|
"heck",
|
|
2062
2063
|
"proc-macro2",
|
|
@@ -2348,6 +2349,7 @@ dependencies = [
|
|
|
2348
2349
|
"pin-project-lite",
|
|
2349
2350
|
"quinn",
|
|
2350
2351
|
"rustls",
|
|
2352
|
+
"rustls-native-certs",
|
|
2351
2353
|
"rustls-pki-types",
|
|
2352
2354
|
"serde",
|
|
2353
2355
|
"serde_json",
|
|
@@ -2392,9 +2394,9 @@ dependencies = [
|
|
|
2392
2394
|
|
|
2393
2395
|
[[package]]
|
|
2394
2396
|
name = "rustc-hash"
|
|
2395
|
-
version = "2.1.
|
|
2397
|
+
version = "2.1.2"
|
|
2396
2398
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2397
|
-
checksum = "
|
|
2399
|
+
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
|
2398
2400
|
|
|
2399
2401
|
[[package]]
|
|
2400
2402
|
name = "rusticata-macros"
|
|
@@ -2873,9 +2875,9 @@ dependencies = [
|
|
|
2873
2875
|
|
|
2874
2876
|
[[package]]
|
|
2875
2877
|
name = "tinystr"
|
|
2876
|
-
version = "0.8.
|
|
2878
|
+
version = "0.8.3"
|
|
2877
2879
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2878
|
-
checksum = "
|
|
2880
|
+
checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
|
|
2879
2881
|
dependencies = [
|
|
2880
2882
|
"displaydoc",
|
|
2881
2883
|
"zerovec",
|
|
@@ -3241,9 +3243,9 @@ dependencies = [
|
|
|
3241
3243
|
|
|
3242
3244
|
[[package]]
|
|
3243
3245
|
name = "wasm-bindgen"
|
|
3244
|
-
version = "0.2.
|
|
3246
|
+
version = "0.2.117"
|
|
3245
3247
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3246
|
-
checksum = "
|
|
3248
|
+
checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
|
|
3247
3249
|
dependencies = [
|
|
3248
3250
|
"cfg-if",
|
|
3249
3251
|
"once_cell",
|
|
@@ -3256,23 +3258,19 @@ dependencies = [
|
|
|
3256
3258
|
|
|
3257
3259
|
[[package]]
|
|
3258
3260
|
name = "wasm-bindgen-futures"
|
|
3259
|
-
version = "0.4.
|
|
3261
|
+
version = "0.4.67"
|
|
3260
3262
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3261
|
-
checksum = "
|
|
3263
|
+
checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e"
|
|
3262
3264
|
dependencies = [
|
|
3263
|
-
"cfg-if",
|
|
3264
|
-
"futures-util",
|
|
3265
3265
|
"js-sys",
|
|
3266
|
-
"once_cell",
|
|
3267
3266
|
"wasm-bindgen",
|
|
3268
|
-
"web-sys",
|
|
3269
3267
|
]
|
|
3270
3268
|
|
|
3271
3269
|
[[package]]
|
|
3272
3270
|
name = "wasm-bindgen-macro"
|
|
3273
|
-
version = "0.2.
|
|
3271
|
+
version = "0.2.117"
|
|
3274
3272
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3275
|
-
checksum = "
|
|
3273
|
+
checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
|
|
3276
3274
|
dependencies = [
|
|
3277
3275
|
"quote",
|
|
3278
3276
|
"wasm-bindgen-macro-support",
|
|
@@ -3280,9 +3278,9 @@ dependencies = [
|
|
|
3280
3278
|
|
|
3281
3279
|
[[package]]
|
|
3282
3280
|
name = "wasm-bindgen-macro-support"
|
|
3283
|
-
version = "0.2.
|
|
3281
|
+
version = "0.2.117"
|
|
3284
3282
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3285
|
-
checksum = "
|
|
3283
|
+
checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
|
|
3286
3284
|
dependencies = [
|
|
3287
3285
|
"bumpalo",
|
|
3288
3286
|
"proc-macro2",
|
|
@@ -3293,18 +3291,18 @@ dependencies = [
|
|
|
3293
3291
|
|
|
3294
3292
|
[[package]]
|
|
3295
3293
|
name = "wasm-bindgen-shared"
|
|
3296
|
-
version = "0.2.
|
|
3294
|
+
version = "0.2.117"
|
|
3297
3295
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3298
|
-
checksum = "
|
|
3296
|
+
checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
|
|
3299
3297
|
dependencies = [
|
|
3300
3298
|
"unicode-ident",
|
|
3301
3299
|
]
|
|
3302
3300
|
|
|
3303
3301
|
[[package]]
|
|
3304
3302
|
name = "wasm-bindgen-test"
|
|
3305
|
-
version = "0.3.
|
|
3303
|
+
version = "0.3.67"
|
|
3306
3304
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3307
|
-
checksum = "
|
|
3305
|
+
checksum = "941c102b3f0c15b6d72a53205e09e6646aafcf2991e18412cc331dbac1806bc0"
|
|
3308
3306
|
dependencies = [
|
|
3309
3307
|
"async-trait",
|
|
3310
3308
|
"cast",
|
|
@@ -3324,9 +3322,9 @@ dependencies = [
|
|
|
3324
3322
|
|
|
3325
3323
|
[[package]]
|
|
3326
3324
|
name = "wasm-bindgen-test-macro"
|
|
3327
|
-
version = "0.3.
|
|
3325
|
+
version = "0.3.67"
|
|
3328
3326
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3329
|
-
checksum = "
|
|
3327
|
+
checksum = "a26bd6570f39bb1440fd8f01b63461faaf2a3f6078a508e4e54efa99363108d2"
|
|
3330
3328
|
dependencies = [
|
|
3331
3329
|
"proc-macro2",
|
|
3332
3330
|
"quote",
|
|
@@ -3335,9 +3333,9 @@ dependencies = [
|
|
|
3335
3333
|
|
|
3336
3334
|
[[package]]
|
|
3337
3335
|
name = "wasm-bindgen-test-shared"
|
|
3338
|
-
version = "0.2.
|
|
3336
|
+
version = "0.2.117"
|
|
3339
3337
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3340
|
-
checksum = "
|
|
3338
|
+
checksum = "1c29582b14d5bf030b02fa232b9b57faf2afc322d2c61964dd80bad02bf76207"
|
|
3341
3339
|
|
|
3342
3340
|
[[package]]
|
|
3343
3341
|
name = "wasm-encoder"
|
|
@@ -3388,9 +3386,9 @@ dependencies = [
|
|
|
3388
3386
|
|
|
3389
3387
|
[[package]]
|
|
3390
3388
|
name = "web-sys"
|
|
3391
|
-
version = "0.3.
|
|
3389
|
+
version = "0.3.94"
|
|
3392
3390
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3393
|
-
checksum = "
|
|
3391
|
+
checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a"
|
|
3394
3392
|
dependencies = [
|
|
3395
3393
|
"js-sys",
|
|
3396
3394
|
"wasm-bindgen",
|
|
@@ -3760,9 +3758,9 @@ dependencies = [
|
|
|
3760
3758
|
|
|
3761
3759
|
[[package]]
|
|
3762
3760
|
name = "writeable"
|
|
3763
|
-
version = "0.6.
|
|
3761
|
+
version = "0.6.3"
|
|
3764
3762
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3765
|
-
checksum = "
|
|
3763
|
+
checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
|
|
3766
3764
|
|
|
3767
3765
|
[[package]]
|
|
3768
3766
|
name = "x509-parser"
|
|
@@ -3792,9 +3790,9 @@ dependencies = [
|
|
|
3792
3790
|
|
|
3793
3791
|
[[package]]
|
|
3794
3792
|
name = "yoke"
|
|
3795
|
-
version = "0.8.
|
|
3793
|
+
version = "0.8.2"
|
|
3796
3794
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3797
|
-
checksum = "
|
|
3795
|
+
checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
|
|
3798
3796
|
dependencies = [
|
|
3799
3797
|
"stable_deref_trait",
|
|
3800
3798
|
"yoke-derive",
|
|
@@ -3803,9 +3801,9 @@ dependencies = [
|
|
|
3803
3801
|
|
|
3804
3802
|
[[package]]
|
|
3805
3803
|
name = "yoke-derive"
|
|
3806
|
-
version = "0.8.
|
|
3804
|
+
version = "0.8.2"
|
|
3807
3805
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3808
|
-
checksum = "
|
|
3806
|
+
checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
|
|
3809
3807
|
dependencies = [
|
|
3810
3808
|
"proc-macro2",
|
|
3811
3809
|
"quote",
|
|
@@ -3815,18 +3813,18 @@ dependencies = [
|
|
|
3815
3813
|
|
|
3816
3814
|
[[package]]
|
|
3817
3815
|
name = "zerocopy"
|
|
3818
|
-
version = "0.8.
|
|
3816
|
+
version = "0.8.48"
|
|
3819
3817
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3820
|
-
checksum = "
|
|
3818
|
+
checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
|
|
3821
3819
|
dependencies = [
|
|
3822
3820
|
"zerocopy-derive",
|
|
3823
3821
|
]
|
|
3824
3822
|
|
|
3825
3823
|
[[package]]
|
|
3826
3824
|
name = "zerocopy-derive"
|
|
3827
|
-
version = "0.8.
|
|
3825
|
+
version = "0.8.48"
|
|
3828
3826
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3829
|
-
checksum = "
|
|
3827
|
+
checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
|
|
3830
3828
|
dependencies = [
|
|
3831
3829
|
"proc-macro2",
|
|
3832
3830
|
"quote",
|
|
@@ -3835,18 +3833,18 @@ dependencies = [
|
|
|
3835
3833
|
|
|
3836
3834
|
[[package]]
|
|
3837
3835
|
name = "zerofrom"
|
|
3838
|
-
version = "0.1.
|
|
3836
|
+
version = "0.1.7"
|
|
3839
3837
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3840
|
-
checksum = "
|
|
3838
|
+
checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
|
|
3841
3839
|
dependencies = [
|
|
3842
3840
|
"zerofrom-derive",
|
|
3843
3841
|
]
|
|
3844
3842
|
|
|
3845
3843
|
[[package]]
|
|
3846
3844
|
name = "zerofrom-derive"
|
|
3847
|
-
version = "0.1.
|
|
3845
|
+
version = "0.1.7"
|
|
3848
3846
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3849
|
-
checksum = "
|
|
3847
|
+
checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
|
|
3850
3848
|
dependencies = [
|
|
3851
3849
|
"proc-macro2",
|
|
3852
3850
|
"quote",
|
|
@@ -3876,9 +3874,9 @@ dependencies = [
|
|
|
3876
3874
|
|
|
3877
3875
|
[[package]]
|
|
3878
3876
|
name = "zerotrie"
|
|
3879
|
-
version = "0.2.
|
|
3877
|
+
version = "0.2.4"
|
|
3880
3878
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3881
|
-
checksum = "
|
|
3879
|
+
checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
|
|
3882
3880
|
dependencies = [
|
|
3883
3881
|
"displaydoc",
|
|
3884
3882
|
"yoke",
|
|
@@ -3887,9 +3885,9 @@ dependencies = [
|
|
|
3887
3885
|
|
|
3888
3886
|
[[package]]
|
|
3889
3887
|
name = "zerovec"
|
|
3890
|
-
version = "0.11.
|
|
3888
|
+
version = "0.11.6"
|
|
3891
3889
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3892
|
-
checksum = "
|
|
3890
|
+
checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
|
|
3893
3891
|
dependencies = [
|
|
3894
3892
|
"yoke",
|
|
3895
3893
|
"zerofrom",
|
|
@@ -3898,9 +3896,9 @@ dependencies = [
|
|
|
3898
3896
|
|
|
3899
3897
|
[[package]]
|
|
3900
3898
|
name = "zerovec-derive"
|
|
3901
|
-
version = "0.11.
|
|
3899
|
+
version = "0.11.3"
|
|
3902
3900
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3903
|
-
checksum = "
|
|
3901
|
+
checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
|
|
3904
3902
|
dependencies = [
|
|
3905
3903
|
"proc-macro2",
|
|
3906
3904
|
"quote",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "primp"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.2"
|
|
4
4
|
description = "HTTP client with browser impersonation capabilities"
|
|
5
5
|
keywords = ["http", "request", "client", "impersonate"]
|
|
6
6
|
categories = ["web-programming::http-client"]
|
|
@@ -72,7 +72,6 @@ rand = { version = "0.10", optional = true }
|
|
|
72
72
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
73
73
|
h2 = { version = "0.4", features = ["unstable"] }
|
|
74
74
|
rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "impersonate", "zlib"] }
|
|
75
|
-
webpki-roots = "1"
|
|
76
75
|
|
|
77
76
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
78
77
|
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] }
|
|
@@ -47,6 +47,8 @@ pub struct ClientBuilder {
|
|
|
47
47
|
impersonate: Option<Impersonate>,
|
|
48
48
|
#[cfg(not(target_arch = "wasm32"))]
|
|
49
49
|
os_type: Option<ImpersonateOS>,
|
|
50
|
+
#[cfg(not(target_arch = "wasm32"))]
|
|
51
|
+
root_certs: Vec<reqwest::Certificate>,
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
impl Default for ClientBuilder {
|
|
@@ -66,6 +68,8 @@ impl ClientBuilder {
|
|
|
66
68
|
impersonate: None,
|
|
67
69
|
#[cfg(not(target_arch = "wasm32"))]
|
|
68
70
|
os_type: None,
|
|
71
|
+
#[cfg(not(target_arch = "wasm32"))]
|
|
72
|
+
root_certs: Vec::new(),
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
|
|
@@ -73,29 +77,13 @@ impl ClientBuilder {
|
|
|
73
77
|
pub fn build(self) -> crate::Result<Client> {
|
|
74
78
|
#[cfg(not(target_arch = "wasm32"))]
|
|
75
79
|
let inner = match (self.impersonate, self.os_type) {
|
|
76
|
-
(Some(impersonate), Some(os_type)) => {
|
|
77
|
-
let settings = imp::get_browser_settings(impersonate, Some(os_type));
|
|
78
|
-
apply_impersonation(self.inner, settings)?
|
|
79
|
-
}
|
|
80
|
-
(Some(Impersonate::Random), None) => {
|
|
81
|
-
let settings =
|
|
82
|
-
imp::get_browser_settings(Impersonate::Random, Some(ImpersonateOS::Random));
|
|
83
|
-
apply_impersonation(self.inner, settings)?
|
|
84
|
-
}
|
|
85
|
-
(Some(impersonate), None) => {
|
|
86
|
-
let settings = imp::get_browser_settings(impersonate, Some(ImpersonateOS::Random));
|
|
87
|
-
apply_impersonation(self.inner, settings)?
|
|
88
|
-
}
|
|
89
|
-
(None, Some(ImpersonateOS::Random)) => {
|
|
90
|
-
let settings =
|
|
91
|
-
imp::get_browser_settings(Impersonate::Random, Some(ImpersonateOS::Random));
|
|
92
|
-
apply_impersonation(self.inner, settings)?
|
|
93
|
-
}
|
|
94
|
-
(None, Some(os_type)) => {
|
|
95
|
-
let settings = imp::get_browser_settings(Impersonate::Random, Some(os_type));
|
|
96
|
-
apply_impersonation(self.inner, settings)?
|
|
97
|
-
}
|
|
98
80
|
(None, None) => self.inner.build()?,
|
|
81
|
+
_ => {
|
|
82
|
+
let imp = self.impersonate.unwrap_or(Impersonate::Random);
|
|
83
|
+
let os = self.os_type.unwrap_or(ImpersonateOS::Random);
|
|
84
|
+
let settings = imp::get_browser_settings(imp, Some(os));
|
|
85
|
+
apply_impersonation(self.inner, settings, &self.root_certs)?
|
|
86
|
+
}
|
|
99
87
|
};
|
|
100
88
|
|
|
101
89
|
#[cfg(target_arch = "wasm32")]
|
|
@@ -404,6 +392,8 @@ impl ClientBuilder {
|
|
|
404
392
|
|
|
405
393
|
/// Add custom certificate roots.
|
|
406
394
|
pub fn add_root_certificate(mut self, cert: reqwest::Certificate) -> Self {
|
|
395
|
+
#[cfg(not(target_arch = "wasm32"))]
|
|
396
|
+
self.root_certs.push(cert.clone());
|
|
407
397
|
self.inner = self.inner.add_root_certificate(cert);
|
|
408
398
|
self
|
|
409
399
|
}
|
|
@@ -528,6 +518,14 @@ impl Client {
|
|
|
528
518
|
pub fn set_proxies(&mut self, proxies: Vec<reqwest::Proxy>) {
|
|
529
519
|
self.inner.set_proxies(proxies)
|
|
530
520
|
}
|
|
521
|
+
|
|
522
|
+
/// Set the redirect policy for the client.
|
|
523
|
+
///
|
|
524
|
+
/// This allows changing redirect behavior at runtime without rebuilding the client.
|
|
525
|
+
/// Use `Policy::none()` to disable redirects, or `Policy::limited(n)` to set a limit.
|
|
526
|
+
pub fn set_redirect_policy(&mut self, policy: reqwest::redirect::Policy) {
|
|
527
|
+
self.inner.set_redirect_policy(policy);
|
|
528
|
+
}
|
|
531
529
|
}
|
|
532
530
|
|
|
533
531
|
impl Default for Client {
|
|
@@ -545,9 +543,10 @@ pub async fn get<T: IntoUrl>(url: T) -> crate::Result<Response> {
|
|
|
545
543
|
fn apply_impersonation(
|
|
546
544
|
builder: reqwest::ClientBuilder,
|
|
547
545
|
settings: BrowserSettings,
|
|
546
|
+
custom_certs: &[reqwest::Certificate],
|
|
548
547
|
) -> crate::Result<reqwest::Client> {
|
|
549
548
|
// Build rustls::ClientConfig with impersonation TLS settings
|
|
550
|
-
let tls_config = build_impersonate_tls_config(&settings)
|
|
549
|
+
let tls_config = build_impersonate_tls_config(&settings, custom_certs)?;
|
|
551
550
|
|
|
552
551
|
// Apply TLS configuration
|
|
553
552
|
let builder = builder.use_preconfigured_tls(tls_config);
|
|
@@ -574,7 +573,10 @@ fn apply_impersonation(
|
|
|
574
573
|
}
|
|
575
574
|
|
|
576
575
|
#[cfg(not(target_arch = "wasm32"))]
|
|
577
|
-
fn build_impersonate_tls_config(
|
|
576
|
+
fn build_impersonate_tls_config(
|
|
577
|
+
settings: &BrowserSettings,
|
|
578
|
+
custom_certs: &[reqwest::Certificate],
|
|
579
|
+
) -> crate::Result<rustls::ClientConfig> {
|
|
578
580
|
use rustls::client::EchMode;
|
|
579
581
|
use std::sync::Arc;
|
|
580
582
|
|
|
@@ -582,9 +584,13 @@ fn build_impersonate_tls_config(settings: &BrowserSettings) -> rustls::ClientCon
|
|
|
582
584
|
.cloned()
|
|
583
585
|
.unwrap_or_else(|| Arc::new(rustls::crypto::aws_lc_rs::default_provider()));
|
|
584
586
|
|
|
585
|
-
//
|
|
586
|
-
|
|
587
|
-
root_store.
|
|
587
|
+
// Use cached root store with both webpki roots and native OS root CAs.
|
|
588
|
+
// If custom certs are provided, merge them in.
|
|
589
|
+
let root_store = if custom_certs.is_empty() {
|
|
590
|
+
reqwest::tls::default_root_store().clone()
|
|
591
|
+
} else {
|
|
592
|
+
reqwest::tls::merged_root_store(custom_certs.to_vec())?
|
|
593
|
+
};
|
|
588
594
|
|
|
589
595
|
// ECH GREASE is only used for Chrome-based browsers and Firefox to match JA4 fingerprint
|
|
590
596
|
// Safari does NOT use ECH GREASE
|
|
@@ -629,7 +635,7 @@ fn build_impersonate_tls_config(settings: &BrowserSettings) -> rustls::ClientCon
|
|
|
629
635
|
});
|
|
630
636
|
}
|
|
631
637
|
|
|
632
|
-
config
|
|
638
|
+
Ok(config)
|
|
633
639
|
}
|
|
634
640
|
|
|
635
641
|
#[cfg(not(target_arch = "wasm32"))]
|
|
Binary file
|