Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ members = [
[patch.crates-io]
h2 = { git = "https://github.com/apify/h2", rev = "7f393a728a8db07cabb1b78d2094772b33943b9a" }
rustls = { git = "https://github.com/apify/rustls", rev="b158c57cf02dcae81c11a73389c599269bb74621" }
tower-http = { git = "https://github.com/apify/tower-http", rev="f9efc0d9193e774d33aedc1022b922efefc22052" }
hyper-util = { git = "https://github.com/apify/hyper-util", rev="9b7795dfd7158fc55e7c84b65bf1dae1d2dea67d" }
tower-http = { git = "https://github.com/apify/tower-http", rev="4d96dbd81f86559c38cf76b8ce671089544a26e3" }
hyper-util = { git = "https://github.com/apify/hyper-util", rev="401e6fb99bb6bd4956a0fafca39f4b7b37be8a0a" }
reqwest = { git = "https://github.com/seanmonstar/reqwest", rev="2230ed3945fb2908692b88dad1dcd06db9fb2ca6" }

[profile.release]
strip = true # Automatically strip symbols from the binary.
Expand Down
36 changes: 26 additions & 10 deletions impit/src/fingerprint/database/chrome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ pub mod chrome_151 {
// 15663105, which is what the capture shows on the wire.
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -276,8 +278,10 @@ pub mod chrome_142 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -417,8 +421,10 @@ pub mod chrome_136 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -552,8 +558,10 @@ pub mod chrome_133 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -687,8 +695,10 @@ pub mod chrome_124 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -825,8 +835,10 @@ pub mod chrome_131 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -957,8 +969,10 @@ pub mod chrome_100 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: Some(1_000),
}
}

Expand Down Expand Up @@ -1057,7 +1071,7 @@ pub mod chrome_107 {
"Chrome",
"107",
chrome_100::tls_fingerprint(),
chrome_100::http2_fingerprint(), // TODO Chrome 107 uses different HTTP/2 settings
chrome_100::http2_fingerprint(),
headers(),
)
}
Expand Down Expand Up @@ -1090,7 +1104,7 @@ pub mod chrome_110 {
"Chrome",
"110",
chrome_100::tls_fingerprint(),
chrome_100::http2_fingerprint(), // TODO Chrome 110 uses different HTTP/2 settings
chrome_100::http2_fingerprint(),
headers(),
)
}
Expand Down Expand Up @@ -1123,7 +1137,7 @@ pub mod chrome_116 {
"Chrome",
"116",
chrome_100::tls_fingerprint(),
chrome_100::http2_fingerprint(), // TODO Chrome 116 uses different HTTP/2 settings
chrome_100::http2_fingerprint(),
headers(),
)
}
Expand Down Expand Up @@ -1258,8 +1272,10 @@ pub mod chrome_125 {
":status".to_string(),
],
initial_stream_window_size: Some(6_291_456),
initial_connection_window_size: Some(15_663_105),
initial_connection_window_size: Some(15_728_640),
max_header_list_size: Some(262_144),
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down
12 changes: 9 additions & 3 deletions impit/src/fingerprint/database/firefox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ pub mod firefox_128 {
":status".to_string(),
],
initial_stream_window_size: Some(131_072),
initial_connection_window_size: Some(12_517_377),
initial_connection_window_size: Some(12_582_912),
max_header_list_size: None,
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -262,8 +264,10 @@ pub mod firefox_133 {
":status".to_string(),
],
initial_stream_window_size: Some(131_072),
initial_connection_window_size: Some(12_517_377),
initial_connection_window_size: Some(12_582_912),
max_header_list_size: None,
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down Expand Up @@ -408,8 +412,10 @@ pub mod firefox_135 {
":status".to_string(),
],
initial_stream_window_size: Some(131_072),
initial_connection_window_size: Some(12_517_377),
initial_connection_window_size: Some(12_582_912),
max_header_list_size: None,
header_table_size: Some(65_536),
max_concurrent_streams: None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions impit/src/fingerprint/database/okhttp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ fn shared_http2_fingerprint() -> Http2Fingerprint {
// Connection window is also increased to 16 MiB via WINDOW_UPDATE
initial_connection_window_size: Some(16_777_216),
max_header_list_size: None,
header_table_size: None,
max_concurrent_streams: None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions impit/src/fingerprint/database/safari.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ pub mod ios_18 {
// 65_535 (h2 default) + 10_420_225 WINDOW_UPDATE = 10_485_760.
initial_connection_window_size: Some(10_485_760),
max_header_list_size: None,
header_table_size: None,
max_concurrent_streams: Some(100),
}
}

Expand Down
2 changes: 2 additions & 0 deletions impit/src/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ pub struct Http2Fingerprint {
pub initial_stream_window_size: Option<u32>,
pub initial_connection_window_size: Option<u32>,
pub max_header_list_size: Option<u32>,
pub header_table_size: Option<u32>,
pub max_concurrent_streams: Option<u32>,
}

/// TLS extensions configuration.
Expand Down
8 changes: 8 additions & 0 deletions impit/src/impit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ impl<CookieStoreImpl: CookieStore + 'static> Impit<CookieStoreImpl> {
if let Some(max_size) = fingerprint.http2.max_header_list_size {
client = client.http2_max_header_list_size(max_size);
}

if let Some(size) = fingerprint.http2.header_table_size {
client = client.http2_header_table_size(size);
}

if let Some(max) = fingerprint.http2.max_concurrent_streams {
client = client.http2_max_concurrent_streams(max);
}
}

if config.max_http_version == Version::HTTP_3 {
Expand Down
Loading