Hackney 4 trims the client down. The HTTP/2 and HTTP/3 stacks are now delegated to erlang_h2 and erlang_quic, so hackney no longer ships its own framing, HPACK / QPACK codecs, control streams or state machines. The HTTP/3 path is fully RFC 9114 compliant via quic_h3, with ALPN negotiation, Alt-Svc discovery (RFC 7838), and the same hackney:request/5 API as HTTP/1.1.
The bundled metrics subsystem is gone. In its place a Go-style middleware chain runs around hackney:request/1..5, configured per request with {middleware, [Fun, ...]} or globally via application:set_env(hackney, middleware, [...]). Users plug in prometheus, telemetry or anything else without hackney owning the policy. See the Middleware Guide and the HTTP/3 Guide.
Breaking
- Removed
hackney_metrics,hackney_metrics_backend,hackney_metrics_prometheus,hackney_metrics_dummy. Themetrics_backendapp env is no longer read. Migration recipes for prometheus and telemetry are inguides/middleware.md. Pool state is still observable throughhackney_pool:get_stats/1. - HTTP/2 and HTTP/3 low-level message tags and modules moved to the new libraries. The user-facing
hackney:request/5API is unchanged.
What's new
- Middleware chain (
hackney_middleware): outermost-first composition, request rewrite, response rewrite, short-circuit, per-request or global config. - HTTP/3 via
quic_h3: pure Erlang QUIC stack, no NIFs. ALPN-negotiated, opt-in with{protocols, [http3, http2, http1]}orapplication:set_env(hackney, default_protocols, [http3, http2, http1]). - Alt-Svc auto-discovery: server
Alt-Svcheaders are now parsed and cached on every response (HTTP/1.1, HTTP/2 and HTTP/3), so subsequent requests can upgrade to HTTP/3 transparently. Honorsclearand merges multipleAlt-Svcheaders per RFC 7230 §3.2.2. - HTTP/2 connection-pooling stability fixes for sustained concurrent load (#836).
Deps
h20.4.0quic1.0.0
Full changelog: https://github.com/benoitc/hackney/blob/4.0.0/NEWS.md