http-quik 0.1.11

High-fidelity, stealth-optimized HTTP transport engine for Chrome 148 identity parity.
Documentation
//! Google Chrome fingerprinted HTTP/3 configuration profile.
//!
//! This module implements application-layer configuration parameters to match
//! the network footprints of modern Chromium-based engines (v148).
//! In stealth scanning and protocol emulation contexts, mismatches in these parameters
//! (such as QPACK limits or GREASE settings) are easily flagged by Web Application Firewalls (WAFs).

/// A QPACK dynamic table size limit of 0 disables dynamic table compression.
/// Chromium configures this to prevent decoder stream blocking, ensuring
/// that field representations rely only on static table references and literals.
const CHROME_SETTINGS_QPACK_MAX_TABLE_CAPACITY: u64 = 0;

/// A maximum field section size of 0 indicates no specific limit is enforced.
/// Chromium defaults to this setting to let the application layer handle
/// header size validation, avoiding early protocol-level rejection.
const CHROME_SETTINGS_MAX_FIELD_SECTION_SIZE: u64 = 0;

/// Chromium configures 0 blocked streams because dynamic table compression is disabled.
/// This guarantees that headers can always be decoded immediately upon receipt,
/// eliminating Head-of-Line blocking in the header stream.
const CHROME_SETTINGS_QPACK_BLOCKED_STREAMS: u64 = 0;

/// Configures an HTTP/3 settings profile matching the exact identity of Google Chrome 148.
///
/// This function translates the target application-layer configurations into `quiche`'s H3 setup.
///
/// ### Fingerprint Considerations:
/// Active WAF engines scan H3 handshake control frames. Standard libraries emit bounded QPACK
/// parameters which instantly fail identity tests because Chrome 148 operates with unbounded QPACK
/// limits by default. This constructor unifies our protocol footprint with Chrome's live behavior.
pub fn configure_chrome_h3() -> Result<quiche::h3::Config, quiche::h3::Error> {
    let mut config = quiche::h3::Config::new()?;

    // Align header compression context sizes with Chrome 148's exact network stack settings.
    config.set_qpack_max_table_capacity(CHROME_SETTINGS_QPACK_MAX_TABLE_CAPACITY);
    config.set_max_field_section_size(CHROME_SETTINGS_MAX_FIELD_SECTION_SIZE);
    config.set_qpack_blocked_streams(CHROME_SETTINGS_QPACK_BLOCKED_STREAMS);

    // Advertise support for WebSocket bootstrap streams over HTTP/3 (RFC 8441).
    config.enable_extended_connect(true);

    Ok(config)
}