Skip to content

HyperHTTP 2.0.0

Choose a tag to compare

@github-actions github-actions released this 19 Apr 16:59
· 0 commits to continuous-dev since this release

Added

  • Custom zero-copy asyncio.Protocol (FastStream) for the HTTP/1.1 hot path,
    bypassing asyncio.StreamReader and removing intermediate buffer copies.
  • HTTP/2 connection probing that serializes the first TLS handshake per host so
    concurrent requests multiplex onto a single H2 connection instead of racing to
    open several.
  • Optional speed extras: orjson, uvloop, h11, brotli, zstandard
    (installable via pip install 'hyperhttp[speed]').
  • Streaming response API (aiter_bytes, aiter_lines, aread) with strict
    Content-Length validation.
  • DNS cache with Happy Eyeballs-style dual-stack connect.
  • Integration test suite covering HTTP/1.1, HTTP/2, TLS, redirects, framing
    edge cases, retries, and circuit breaker behavior.

Changed

  • Breaking: full rewrite of the client, connection pool, HTTP/1 parser,
    buffer pool, and H2 multiplexer. Public API surface is smaller and
    intentionally incompatible with 1.x.
  • Response.aread now collects raw chunks and joins once with b"".join,
    halving memcpy work for identity-encoded bodies with a known length.
  • Socket tuning: SO_RCVBUF=2 MiB, SO_SNDBUF=1 MiB, TCP_NODELAY,
    SO_KEEPALIVE enabled by default.
  • Error classifier rewritten to map hyperhttp's own exception hierarchy to
    retry / circuit-breaker categories.

Removed

  • Breaking: legacy connection manager, old HTTP/1 and HTTP/2 protocol
    modules, and the pre-2.0 test suite.
  • setup.py (packaging driven entirely by pyproject.toml).

Fixed

  • HTTP/1.1 framing: reject responses with conflicting Content-Length and
    Transfer-Encoding, or multiple Content-Length headers.
  • Body truncation now raises RemoteProtocolError instead of returning a
    short body silently.