diff --git a/Cargo.lock b/Cargo.lock index cc403a56..dd1596aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,13 +23,28 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" +[[package]] +name = "alloc-no-stdlib" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" + [[package]] name = "alloc-stdlib" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" dependencies = [ - "alloc-no-stdlib", + "alloc-no-stdlib 2.0.4", +] + +[[package]] +name = "alloc-stdlib" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" +dependencies = [ + "alloc-no-stdlib 3.0.0", ] [[package]] @@ -84,20 +99,19 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "bindgen" -version = "0.72.1" +version = "0.73.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +checksum = "787ef8ef523575546b106a58213d6e6b06198a05c2f757258c68a74273670cfa" dependencies = [ "bitflags", "cexpr", "clang-sys", - "itertools", "proc-macro2", "quote", "regex", "rustc-hash", - "shlex 1.3.0", - "syn 2.0.119", + "shlex", + "syn 3.0.5", ] [[package]] @@ -121,9 +135,20 @@ version = "8.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3" dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", + "alloc-no-stdlib 2.0.4", + "alloc-stdlib 0.2.4", + "brotli-decompressor 5.0.3", +] + +[[package]] +name = "brotli" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b851b75c23ca7873623d612fe49bd1989aeb03d08fb9432187eb253d3d4c6b" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.0.1", ] [[package]] @@ -132,14 +157,24 @@ version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", + "alloc-no-stdlib 2.0.4", + "alloc-stdlib 0.2.4", +] + +[[package]] +name = "brotli-decompressor" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941cd9bd4ddab83cb46fa5a2d428f1c857b24ac78cb876cf7beb710840934bd7" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", ] [[package]] name = "btls" version = "0.5.6" -source = "git+https://github.com/0x676e67/btls?rev=129887582a538b8f4dcf371d15c953335312ca37#129887582a538b8f4dcf371d15c953335312ca37" +source = "git+https://github.com/0x676e67/btls?rev=ffaf0e8c23d455af4e306986ce81bb57ebd03bc2#ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" dependencies = [ "bitflags", "btls-sys", @@ -151,7 +186,7 @@ dependencies = [ [[package]] name = "btls-sys" version = "0.5.6" -source = "git+https://github.com/0x676e67/btls?rev=129887582a538b8f4dcf371d15c953335312ca37#129887582a538b8f4dcf371d15c953335312ca37" +source = "git+https://github.com/0x676e67/btls?rev=ffaf0e8c23d455af4e306986ce81bb57ebd03bc2#ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" dependencies = [ "bindgen", "cmake", @@ -180,7 +215,7 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex 2.0.1", + "shlex", ] [[package]] @@ -245,7 +280,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "257c7085cbb71be72d8fb97edff08b03d86d5d9f2222b9cc34a6bec87093bc10" dependencies = [ - "brotli", + "brotli 8.0.4", "compression-core", "flate2", "memchr", @@ -901,15 +936,6 @@ dependencies = [ "serde", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" @@ -1647,12 +1673,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "shlex" version = "2.0.1" @@ -1917,8 +1937,7 @@ dependencies = [ [[package]] name = "tokio-btls" version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e1fd638ec35427faf3b8f412e0fdd6fae76591d79dba40f38fa667d22bc44dd" +source = "git+https://github.com/0x676e67/btls?rev=ffaf0e8c23d455af4e306986ce81bb57ebd03bc2#ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" dependencies = [ "btls", "tokio", @@ -2258,7 +2277,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2393,7 +2412,7 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "wreq" version = "0.16.1" -source = "git+https://github.com/0x676e67/wreq?rev=cd76bcdf1307153de289d34e072528bdf0510a3b#cd76bcdf1307153de289d34e072528bdf0510a3b" +source = "git+https://github.com/0x676e67/wreq?rev=4f2342aba1b33cc3534e8e2a853b21945edf6cef#4f2342aba1b33cc3534e8e2a853b21945edf6cef" dependencies = [ "btls", "btls-sys", @@ -2491,9 +2510,9 @@ dependencies = [ [[package]] name = "wreq-util" version = "0.2.0" -source = "git+https://github.com/0x676e67/wreq-util?rev=e3922a2b2d976487cb4cf4e7b0ac290b3ce77f66#e3922a2b2d976487cb4cf4e7b0ac290b3ce77f66" +source = "git+https://github.com/0x676e67/wreq-util?rev=5715529002738f46eea86a7271f918f9374d3582#5715529002738f46eea86a7271f918f9374d3582" dependencies = [ - "brotli", + "brotli 9.0.0", "flate2", "typed-builder", "wreq", diff --git a/Cargo.toml b/Cargo.toml index 837f4d70..d8acc3a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,12 +75,14 @@ tikv-jemallocator = { version = "0.7.0", default-features = false, features = [ "disable_initial_exec_tls", ], optional = true } -# Keep the Chrome 150–153 profiles and their required TLS support in sync. +# Keep the latest emulation profiles and their required TLS support in sync. [patch.crates-io] -wreq-util = { git = "https://github.com/0x676e67/wreq-util", rev = "e3922a2b2d976487cb4cf4e7b0ac290b3ce77f66" } -wreq = { git = "https://github.com/0x676e67/wreq", rev = "cd76bcdf1307153de289d34e072528bdf0510a3b" } -btls = { git = "https://github.com/0x676e67/btls", rev = "129887582a538b8f4dcf371d15c953335312ca37" } -btls-sys = { git = "https://github.com/0x676e67/btls", rev = "129887582a538b8f4dcf371d15c953335312ca37" } +wreq-util = { git = "https://github.com/0x676e67/wreq-util", rev = "5715529002738f46eea86a7271f918f9374d3582" } +wreq = { git = "https://github.com/0x676e67/wreq", rev = "4f2342aba1b33cc3534e8e2a853b21945edf6cef" } +# demo/tokio-btls-vectored-write +btls = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" } +btls-sys = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" } +tokio-btls = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" } [profile.release] codegen-units = 1 diff --git a/docs/source/getting-started/introduction.md b/docs/source/getting-started/introduction.md index 548ed7ad..9998a5d5 100644 --- a/docs/source/getting-started/introduction.md +++ b/docs/source/getting-started/introduction.md @@ -74,7 +74,7 @@ Due to the complexity of **TLS** encryption and the widespread adoption of **HTT --- - `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` + `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` - :fontawesome-brands-edge: **Edge** @@ -86,7 +86,7 @@ Due to the complexity of **TLS** encryption and the widespread adoption of **HTT --- - `Firefox109` `Firefox117` `Firefox128` `Firefox133` `Firefox135` `FirefoxPrivate135` `FirefoxAndroid135` `Firefox136` `FirefoxPrivate136` `Firefox139` `Firefox142` `Firefox143` `Firefox144` `Firefox145` `Firefox146` `Firefox147` `Firefox148` `Firefox149` `Firefox150` `Firefox151` + `Firefox109` `Firefox117` `Firefox128` `Firefox133` `Firefox135` `FirefoxPrivate135` `FirefoxAndroid135` `Firefox136` `FirefoxPrivate136` `Firefox139` `Firefox142` `Firefox143` `Firefox144` `Firefox145` `Firefox146` `Firefox147` `Firefox148` `Firefox149` `Firefox150` `Firefox151` `Firefox152` - :fontawesome-brands-safari: **Safari** diff --git a/docs/source/guide/emulation.md b/docs/source/guide/emulation.md index ccb36084..2a76e5ab 100644 --- a/docs/source/guide/emulation.md +++ b/docs/source/guide/emulation.md @@ -4,6 +4,9 @@ - Firefox/Chrome/Android - Custom TLS/HTTP2 +The built-in profiles include `Profile.Chrome154` and `Profile.Firefox152`. +Use a profile directly, or combine it with a platform using `Emulation`. + ### Simple Firefox Emulation ```python @@ -14,7 +17,7 @@ from wreq.emulation import Emulation async def main(): client = Client( - emulation=Emulation.Firefox135, + emulation=Emulation.Firefox152, ) resp = await client.get("https://tls.peet.ws/api/all") print(f"Status: {resp.status}") @@ -38,7 +41,7 @@ async def main(): resp = await client.get( "https://tls.peet.ws/api/all", emulation=Emulation( - profile=Profile.Chrome134, + profile=Profile.Chrome154, platform=Platform.Android, ), # Disable client default headers diff --git a/python/wreq/emulation.py b/python/wreq/emulation.py index 3ab85b7c..6be5b28e 100644 --- a/python/wreq/emulation.py +++ b/python/wreq/emulation.py @@ -70,6 +70,7 @@ class Profile(Enum): Chrome151 = auto() Chrome152 = auto() Chrome153 = auto() + Chrome154 = auto() # Microsoft Edge versions Edge101 = auto() @@ -113,6 +114,7 @@ class Profile(Enum): Firefox149 = auto() Firefox150 = auto() Firefox151 = auto() + Firefox152 = auto() # Safari versions SafariIos17_2 = auto() @@ -247,6 +249,7 @@ class Emulation: Chrome151: ClassVar[Profile] = Profile.Chrome151 Chrome152: ClassVar[Profile] = Profile.Chrome152 Chrome153: ClassVar[Profile] = Profile.Chrome153 + Chrome154: ClassVar[Profile] = Profile.Chrome154 # Microsoft Edge versions Edge101: ClassVar[Profile] = Profile.Edge101 @@ -290,6 +293,7 @@ class Emulation: Firefox149: ClassVar[Profile] = Profile.Firefox149 Firefox150: ClassVar[Profile] = Profile.Firefox150 Firefox151: ClassVar[Profile] = Profile.Firefox151 + Firefox152: ClassVar[Profile] = Profile.Firefox152 # Safari versions SafariIos17_2: ClassVar[Profile] = Profile.SafariIos17_2 diff --git a/src/emulate.rs b/src/emulate.rs index c6cf2833..923a8cf0 100644 --- a/src/emulate.rs +++ b/src/emulate.rs @@ -54,6 +54,7 @@ define_enum!( Chrome151, Chrome152, Chrome153, + Chrome154, Edge101, Edge122, @@ -95,6 +96,7 @@ define_enum!( Firefox149, Firefox150, Firefox151, + Firefox152, SafariIos17_2, SafariIos17_4_1,