Hackney 3.1.0 - HTTP/3 now pure Erlang, zero C dependencies

Hackney 3.1.0 is now available.

The main change in this release is replacing the lsquic-based QUIC NIF with a pure Erlang implementation. HTTP/3 support now works without
any external dependencies.

What changed:

  • Removed the entire c_src/ directory (~1.3M lines of C code including lsquic and BoringSSL)
  • Removed CMake, Go, and C compiler requirements
  • Added dependency on the quic library (pure Erlang QUIC implementation)
  • Added hackney_qpack module for QPACK header compression (RFC 9204)

What this means for you:

  • rebar3 compile just works - no build scripts, no system dependencies
  • HTTP/3 is available on all platforms where Erlang runs
  • hackney_quic:is_available/0 now always returns true

Usage remains the same:

%% Explicit HTTP/3
hackney:get(“https://example.com”, [], <<>>, [{protocols, [http3]}]).

%% Or let hackney negotiate (uses Alt-Svc)
hackney:get(“https://example.com”, [], <<>>, [{protocols, [http3, http2, http1]}]).

Links:

Feedback and bug reports welcome

20 Likes

Awesome work :grinning_face_with_smiling_eyes:

Looks like cowlib has some QUIC support, I’m curious if you’ve considered using it or if it didn’t fit your needs whatsoever.

And quic’s doc is great!

Wait what, you implemented pure QUIC in Erlang?! :star_struck:

LOVE THIS. Need to check!

1 Like

Yes I plan to make a PR sometimes in the week. There are some some additional changes that need to be merged i erlang_quic

2 Likes

Yes it’s full in erlang :slight_smile: You can check here GitHub - benoitc/erlang_quic: Pure Erlang QUIC implementation (RFC 9000)

4 Likes

forgot to say that the current implemntation in cowboy is using quicer which is using quic nif from emqx based on Microsoft library which is not fully complete and hard to use multi-platform. Originally hackney 3 was using lsquic but this was making the requirements more complex to operate.

4 Likes

Love it, glad you’re moving the needle with the client, people have long said that it was hard and you need to use a NIF and bla bla. As always it’s easier to write in Erlang, with the socket API it should be trivial to do it for the server to.

1 Like

Woah! Sick!

Do you think QUIC could be added to Erlang/OTP itself, or does it still need some time to cook?

3 Likes

Not sure it needs to. It’s pretty new also and need probably some work on internals. But the version 0.8 has most of the spec handled and tested. It passes the interop runner tests.

2 Likes

Took a closer look a the code, was this made by the help of AI?

Yes, I use AI tools to improve test coverage and catch some edge cases. It’s just part of how I work these days.

6 Likes

Fantastic contribution, it will be useful for a lot of projects!

I wonder how the performance compares versus the other implementation(s) based on a NIF. If anyone runs a benchmark, I will be very interested!

1 Like