This guide covers development setup, testing, and contributing to hackney.
- Erlang/OTP 27 or later
- rebar3 3.24.0 or later
macOS:
brew install erlangUbuntu/Debian:
sudo apt-get install erlang build-essentialFreeBSD:
pkg install erlang-runtime28 rebar3Clone the repository:
git clone https://github.com/benoitc/hackney.git
cd hackneyBuild the project:
rebar3 compileThis will compile all Erlang source files and fetch dependencies (including the pure Erlang QUIC library for HTTP/3 support).
Run all tests:
rebar3 eunitRun specific test modules:
rebar3 eunit --module=hackney_quic_tests
rebar3 eunit --module=hackney_http3_testsSome tests require the httpbin server. Start it before running tests:
pip3 install httpbin gunicorn
gunicorn -b 127.0.0.1:8000 httpbin:app &
rebar3 eunitA Dockerfile is provided for testing on Linux locally, which mirrors the GitHub CI environment.
docker build -f Dockerfile.test -t hackney-test .Run all tests:
docker run --rm hackney-testRun specific test modules:
docker run --rm hackney-test bash -c "rebar3 eunit --module=hackney_quic_tests"Start an interactive shell:
docker run --rm -it hackney-test bashThen you can:
- Run tests manually:
rebar3 eunit - Start an Erlang shell:
rebar3 shell
HTTP/3 support uses a pure Erlang QUIC implementation from the quic dependency.
src/hackney_quic.erl- QUIC/HTTP3 transport wrappersrc/hackney_qpack.erl- QPACK header compressionsrc/hackney_h3.erl- HTTP/3 high-level API
The underlying QUIC implementation is in the quic dependency which provides:
- TLS 1.3 handshake
- QUIC packet encoding/decoding
- Congestion control
- Loss recovery
- Follow standard Erlang conventions
- Use edoc for function documentation
- Keep lines under 100 characters
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests locally and in Docker
- Commit with clear messages
- Push and create a pull request
type: short description
Longer description if needed.
Types: fix, feat, docs, test, refactor, ci, chore
CI runs on:
- Linux x86_64 (OTP 27.2, 28.0)
- Linux ARM64 (OTP 27.2)
- macOS ARM64 (OTP 27)
- FreeBSD 14.2 (OTP 28)
All CI jobs must pass before merging.