Skip to main content

connect

Function connect 

Source
pub async fn connect(
    host: &str,
    port: u16,
    addr: SocketAddr,
    profile: &ChromeProfile,
    proxy: Option<&Proxy>,
) -> Result<QuikConnection>
Expand description

Establishes a new network connection following the Chrome 134 transport pipeline.

This function orchestrates a multi-stage handshake to ensure the resulting connection is indistinguishable from a real browser:

  1. Proxy/TCP: Dials the target host (optionally via a SOCKS5/HTTP tunnel).
  2. TLS Handshake: Performs a BoringSSL handshake with ClientHello permutation, GREASE, and extension shuffling.
  3. ALPS/ECH: Injects per-connection application settings (ALPS) and ECH GREASE via raw BoringSSL FFI calls.
  4. H2 Handshake: Negotiates the HTTP/2 session using a specialized builder that replicates Chromium’s SETTINGS frame order and connection window increments.