Skip to content

refactor: replace QUIC NIF with pure Erlang implementation#827

Merged
benoitc merged 8 commits intomasterfrom
http3-pure-erlang
Feb 17, 2026
Merged

refactor: replace QUIC NIF with pure Erlang implementation#827
benoitc merged 8 commits intomasterfrom
http3-pure-erlang

Conversation

@benoitc
Copy link
Owner

@benoitc benoitc commented Feb 17, 2026

Summary

  • Remove c_src/ directory (lsquic, BoringSSL, NIF code) - ~1.3M lines of C code
  • Add hackney_qpack.erl for QPACK header compression (RFC 9204)
  • Update hackney_quic.erl to use pure Erlang quic library
  • Update documentation to reflect zero C dependencies

Benefits

  • No build dependencies: Just rebar3 compile - no CMake, Go, or C compiler needed
  • Portability: Works on any platform Erlang supports
  • Simpler debugging: Erlang tools instead of GDB/LLDB
  • Crash isolation: Process crash instead of potential VM crash
  • Hot code loading: Fully supported

- Remove c_src/ directory (lsquic, BoringSSL, NIF code)
- Remove do_cmake.sh and do_quic.sh build scripts
- Add hackney_qpack.erl for QPACK header compression
- Update hackney_quic.erl to use pure Erlang quic library
- Simplify is_available() to always return true
- Update documentation to reflect no C dependencies
- Remove debug statements from QPACK decoder

HTTP/3 now works with zero external dependencies - just
rebar3 compile. Tested against cloudflare.com.
The encoder was not embedding the name length prefix in the
instruction byte as required by RFC 9204. The literal-with-literal-name
format requires the 3-bit name length prefix to be in the instruction
byte (0010_H_NNN), not as a separate string header.
- Add quic to plt_extra_apps for dialyzer
- Add dialyzer suppression attributes to hackney_quic.erl for
  warnings caused by incomplete type specs in quic library
- Update xref_ignores for quic and hackney_quic/h3 functions
Fixes header protection sampling crash during PTO timeout.
After stream is done, stream_body should return {error, no_stream}.
Check if connection process is alive before calling get_protocol
to avoid noproc errors in CI environments.
@benoitc benoitc merged commit cebfd91 into master Feb 17, 2026
5 checks passed
@benoitc benoitc deleted the http3-pure-erlang branch February 17, 2026 08:18
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

Comments