Repository navigation
v0.2.0
mimicry v0.2.0
Mobile and Windows profiles, a cheaper client constructor, faster HTTP/1.1 uploads, and closer browser behaviour across HTTP/2 and QUIC.
Breaking changes
Accessors name their platform
profiles.Chrome(), Firefox() and Safari() are now profiles.ChromeMacOS(), FirefoxMacOS() and SafariMacOS(), matching ChromeWindows(), FirefoxWindows() and SafariIOS() and the versioned accessors. The old names are removed. (#44)
Profiles are read-only values
Every accessor now return a read-only profile.Profile, checked and compiled once per process. Config.Profile takes that type. Building a client copies nothing: NewClient went from about 250 µs and 126 KB to about 1–2 µs and 2–3 KB.
To customise a profile, edit a copy once and reuse it:
// before
p := profiles.Chrome()
p.X = y
// after
p := profiles.ChromeMacOS().With(func(s *profile.Spec) { s.X = y })profile.Specis the editable data (the oldprofile.Profilestruct, renamed).Withnever fails: an invalid edit is reported byNewClient, with every problem listed.Profile.Spec()returns a deep copy, for reading what a profile sends or saving it withprofile.Encode.profile.Parsereturns aprofile.Profile.- Per-identity headers (
Accept-Language, a user agent) belong inConfig.Header, not in a profile edited per client.
See ExampleProfile_With, ExampleProfile_Spec and decision 0044's amendment. (#41)
New profiles
safari-27-ios(profiles.SafariIOS()): Safari 27.2 on an iPhone. (#34)safari-26-ios(profiles.Safari26IOS()): Safari 26.6 on an iPhone. (#36)firefox-158-windows(profiles.FirefoxWindows()): Firefox 158 on Windows 10. (#39)
All three are captured on the real devices, with gaps listed in profiles/EVIDENCE.md and decisions 0047 and 0051.
Wire behaviour
- HTTP/1.1 uploads are cut into TLS records as each browser cuts them (headers apart or joined, then 16 KB records), and uTLS's slow record-size ramp-up is off, as in every browser. Uploads go from the slowest of the impersonating clients to the fastest at 64 KB. (#33, #37)
- Firefox's QUIC ACKs: an ACK goes at once when a packet arrives a round-trip or more after the last one, as Firefox does, instead of after the 20 ms ACK delay. (#40, #43)
- Safari: resumes HTTP/3 with 0-RTT and closes on the server's GOAWAY; dial delays come from the captures and are off by default (
Config.BrowserDialDelay). (#10, #30) - HTTP/2: a server's GOAWAY is answered with the profile's own (#9, #14); a connection goes idle once a complete body is closed, so
CloseIdleConnectionscloses it (#28, #29). - QUIC: STREAMS_BLOCKED is sent as each browser sends it;
disable_active_migrationis respected; a local close's cause is reported on its streams. (#4, #13, #18, #21, #23, #26) - Headers:
Content-Length,Transfer-EncodingandConnectionare built from the request, never copied from the header map;Connection: closeis honoured over HTTP/1.1. (#3, #16)
Performance and memory
NewClient: about 150× faster, as above. (#41)- HTTP/3: less CPU in the QUIC connection loop: 10 MB uploads 214 → 238 MB/s, 12% less CPU per download. (#38)
- Rotating proxies: state is kept for the 1,024 most recently used proxy identities, and an origin's last closed HTTP/3 connection is no longer kept. (#6, #15, #19)
docs/performance.mdhas the new upload benchmarks and explains the remaining differences from the other clients, all of them browser behaviour mimicry copies on purpose. (#8, #32, #42)
Fixes
- Flaky and load-sensitive tests:
TestUDPECNon macOS,TestPins, the pool hand-off, and an HTTP/3 discovery replay. (#17, #20, #22, #24, #25, #27)