Skip to content

refactor(http2): delegate HTTP/2 to erlang_h2 library#842

Merged
benoitc merged 1 commit intomasterfrom
refactor/http2-via-erlang-h2
Apr 15, 2026
Merged

refactor(http2): delegate HTTP/2 to erlang_h2 library#842
benoitc merged 1 commit intomasterfrom
refactor/http2-via-erlang-h2

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented Apr 15, 2026

Summary

  • Replace hackney's bundled HTTP/2 framing, HPACK codec, and connection/stream state machine with the h2 hex package (0.3.0).
  • hackney_conn attaches an h2_connection gen_statem to the post-ALPN socket and translates {h2, Conn, Event} owner-messages into sync replies and async hackney_response events.
  • Public user-facing API is unchanged (requests, async streaming, pooled HTTP/2, request_async).
  • Server push (RFC 7540 section 8.2) is no longer supported; enable_push is a documented no-op.
  • Removed modules: hackney_http2.erl, hackney_http2_machine.erl, hackney_hpack.erl, hackney_hpack_huffman*.hrl, and the matching tests plus h2spec_SUITE.

Net: +285 / -10399 lines.

Replace the bundled HTTP/2 framing, HPACK codec, and connection/stream
state machine with the h2 hex package (0.3.0). hackney_conn now attaches
an h2_connection gen_statem to the post-ALPN socket and translates
{h2, Conn, Event} owner-messages into sync replies and async
hackney_response events.

Public API is unchanged. Server push (RFC 7540 section 8.2) is no longer
supported; enable_push is a documented no-op.

Removed: hackney_http2.erl, hackney_http2_machine.erl, hackney_hpack.erl,
hackney_hpack_huffman*.hrl, and the matching test/bench suites plus
h2spec_SUITE.
@benoitc benoitc merged commit cc74915 into master Apr 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant