Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 16:29
· 50 commits to main since this release
be6adbc

mimicry v0.4.0

Chrome and Firefox on Linux, Edge on macOS and Windows, Firefox 159 on desktop, Chrome's client hints, and binding to a local address over HTTP/3 too. URLs are now sent as each browser parses them, a trailing-dot host's SNI as each browser sends it, and QPACK on resumed 0-RTT connections starts as the browsers' does.

New profiles

  • chrome-157-linux (profiles.ChromeLinux()) and firefox-159-linux (profiles.FirefoxLinux()). They are captured on Ubuntu 24.04; Chrome and Firefox on Fedora 45 sent the same first requests. Distribution builds and arm64 aren't covered (decision 0058). (#64, #92)

  • edge-157-macos (profiles.EdgeMacOS()) and edge-157-windows (profiles.EdgeWindows()), captured on their own rather than derived from Chrome. Edge differs from Chrome 157 in four ways (decision 0059):

    • no Trust Anchor IDs extension;
    • no image/jxl in accept;
    • the Edg/ user agent and "Microsoft Edge" brand;
    • 2-byte packet numbers on its second QUIC Initial.

    (#65, #94, #96)

  • firefox-159-macos and firefox-159-windows: profiles.FirefoxMacOS() and profiles.FirefoxWindows() now return them. The 158 profiles stay. (#76, #82)

New API

  • Config.LocalAddrs (at most one IPv4 and one IPv6 address) binds every socket mimicry opens itself: TCP, QUIC's UDP sockets and SOCKS5 UDP relays. Before, HTTP/3 ignored DialContext and left from the host's default address while HTTP/2 left from the bound one. (#81, #87)

  • Client hints (Chrome and Edge profiles; decision 0055). A navigation's Accept-CH is kept per origin and the hints are sent where Chrome sends them:

    • Critical-CH restarts a GET navigation once, on the same connection;
    • Clear-Site-Data empties the origin's set;
    • Config.ClientHintStore holds the hints: nil keeps one per Transport, and NewClientHintStore() returns a MemoryClientHintStore that saves and loads as JSON;
    • Config.ClientHints sets the machine the hints describe, and profiles.Machines and profiles.RandomMachine list the captured ones;
    • Request.ClientHints (HintsDelegated, HintsWithheld) says whether the page delegates its hints to another origin.

    (#62, #83, #84, #85)

  • req.URL.Opaque sends the request target exactly as written, path and query, as net/http does. Use it for a target a browser would rewrite, or one Go's URL parser refuses, like a lone %. (#71, #89)

Behaviour changes

These don't change the API, but a request can now go out differently than in v0.3.0:

  • URLs are sent as the browsers parse them, as measured in a new urls capture of 43 awkward URLs (decision 0057):

    • ' in a query becomes %27;
    • in a path, \ becomes / and dot segments are resolved;
    • an IPv4 host in any form becomes dotted decimal;
    • Chrome and Edge encode | in a path;
    • Firefox and Safari 26 refuse an invalid xn-- host.

    (#71, #89)

  • A trailing-dot host's SNI (https://example.com./) is sent as each browser sends it:

    • Chrome, Edge and Firefox keep the dot;
    • Safari and the iPhone profiles send no SNI, and still verify the certificate against the host.

    Before, the dot was dropped for every profile. (#88, #97, #99; uTLS fork roachadam/utls#18)

  • QPACK on a resumed 0-RTT connection: the encoder starts from the server's SETTINGS remembered with the ticket, as Chrome, Edge and Firefox do. Chrome and Edge set the table capacity again once the server's SETTINGS arrive. Before, a 0-RTT connection used no dynamic table until the handshake finished. A server that shrinks its SETTINGS on such a connection gets H3_SETTINGS_ERROR, as RFC 9114 says. (#90, #98, #99)

  • Firefox's QUIC packet numbers: before anything in a packet number space is acknowledged, a packet number goes in the fewest bytes that hold it, as Firefox does (RFC 9000 appendix A.2 asks for twice that range). This only affects Firefox's random first Initial, in about 1.6% of connections. (#91, #93)

Profiles and tooling

  • Older profiles measured:

    • firefox-158-macos and firefox-158-windows are measured for trailing-dot SNI, URLs and QPACK, from Firefox 158 itself.
    • chrome-155-macos is measured for the two network-stack rules (trailing-dot SNI and QPACK on resumption), from Chrome for Testing 155. Its URL rules stay unmeasured: | in a path and invalid xn-- hosts fail with ErrNotMeasured.

    (#99)

  • Capture tooling:

    • cmd/refresh captures Linux through WSL (-linux, -wsl) and Edge;
    • cmd/capture -firefox-app and -chrome-app take a specific browser build;
    • the release watch follows Edge Stable.

    (#92, #94, #99)

  • CI: main's harness tests take about a third of the time they did. The race detector no longer runs on single-goroutine code, and tests that wait on page timers run more subtests at once. (#100, #101)