Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
2069222
feat: add hackney_conn gen_statem for process-per-connection model
benoitc Dec 29, 2025
b4dfada
feat: add request/response handling to hackney_conn
benoitc Dec 29, 2025
d9433f6
feat(conn): add async streaming support to hackney_conn
benoitc Dec 29, 2025
de4bb5f
feat(conn): create hackney_conn_sup supervisor
benoitc Dec 29, 2025
89e54f6
test: add generic HTTP test resource
benoitc Dec 31, 2025
13bfc96
test: use embedded Cowboy server in stream tests
benoitc Dec 31, 2025
155fb41
test: use embedded Cowboy server in conn tests
benoitc Dec 31, 2025
7829ec8
test: convert hackney_integration_tests to use embedded Cowboy server
benoitc Jan 1, 2026
28757f7
chore: consolidate pool tests, remove jsone dependency
benoitc Jan 1, 2026
2c93182
feat: restore hackney_socks5.erl with ssl_opts/2 in hackney_ssl
benoitc Jan 1, 2026
a23de8f
feat: restore hackney_http_connect.erl and export default_ua/0
benoitc Jan 1, 2026
dc41b79
refactor: process-per-connection architecture
benoitc Jan 1, 2026
a0aec23
test: update tests for process-per-connection model
benoitc Jan 1, 2026
a84f477
docs: add 2.0.0 release notes and update config
benoitc Jan 1, 2026
8e10625
fix(http_connect): read full HTTP response before SSL upgrade
benoitc Jan 1, 2026
4affa8c
feat(url): add parse_proxy_url/1 and socks5:// URL support
benoitc Jan 2, 2026
114d6aa
feat(proxy): add get_proxy_config/2 helper function
benoitc Jan 2, 2026
db65ab7
feat(conn): support pre-established socket in hackney_conn
benoitc Jan 3, 2026
8da5302
feat(proxy): add start_conn_with_socket/5 helper
benoitc Jan 3, 2026
cdcedca
feat(proxy): implement HTTP CONNECT proxy support
benoitc Jan 3, 2026
bc5cdd2
feat(proxy): implement SOCKS5 proxy support with tests
benoitc Jan 3, 2026
fbfc984
feat(proxy): implement simple HTTP proxy support
benoitc Jan 3, 2026
c83a197
feat(proxy): add environment variable proxy support with NO_PROXY
benoitc Jan 3, 2026
c0bbb46
fix: resolve dialyzer warnings
benoitc Jan 3, 2026
6fa4bb1
vendor: add cowlib websocket modules for WebSocket support
benoitc Jan 3, 2026
711300d
feat(url): add ws:// and wss:// URL scheme support
benoitc Jan 3, 2026
690ceca
feat(ws): add WebSocket client support
benoitc Jan 3, 2026
cdf851b
feat(ws): add proxy support for WebSocket connections
benoitc Jan 3, 2026
5423cc7
test(ws): add extensive WebSocket test coverage
benoitc Jan 3, 2026
1bd0fd0
test(ws): add scripted interaction and protocol simulation tests
benoitc Jan 3, 2026
cf82dfb
fix(ws): handle gen_statem timeout exit in ws_connect
benoitc Jan 3, 2026
fb6094a
fix(http): remove duplicate CRLF in request construction
benoitc Jan 3, 2026
26ffb3b
fix(test): use jsx for JSON encoding in tests
benoitc Jan 3, 2026
32b22d1
fix(test): fix OTP compatibility issues in tests
benoitc Jan 3, 2026
d835779
test: add unit tests for previously untested modules
benoitc Jan 4, 2026
8c48711
refactor: rename hackney_headers_new to hackney_headers
benoitc Jan 4, 2026
5e461f6
fix(test): resolve port conflicts and fix multipart test
benoitc Jan 4, 2026
371b518
fix: add backward compatibility and update examples
benoitc Jan 5, 2026
439a5c8
fix(ssl,happy): fix insecure option and error propagation
benoitc Jan 5, 2026
288049b
fix(happy): preserve DNS response order for load balancing
benoitc Jan 5, 2026
9e717f5
fix(conn): handle 1XX informational responses correctly
benoitc Jan 5, 2026
4b553f0
fix(test): make localhost test work with IPv6-first resolution
benoitc Jan 5, 2026
a0661a3
fix(test): use ranch for happy tests
benoitc Jan 5, 2026
d24ddc3
docs: add guides and rewrite readme
benoitc Jan 5, 2026
06da915
docs: remove doc/PROXY_TESTING.md (doc/ now for generated files)
benoitc Jan 5, 2026
f01361d
fix(spec): add missing return types to request/1-5 specs
benoitc Jan 5, 2026
d62b00d
fix(test): use dynamic ports in WebSocket tests to avoid port conflicts
benoitc Jan 5, 2026
ec1ffe1
fix: suppress unused variable warnings in hackney_conn
benoitc Jan 5, 2026
97d52f2
refactor: move vendor content to libs/ directory
benoitc Jan 5, 2026
cdc14cb
fix: handle enter events in hackney_conn handle_common
benoitc Jan 5, 2026
b8513d8
fix: track connection owner to prevent pool exhaustion
benoitc Jan 5, 2026
d0fdf40
feat: add per-host load regulation using ETS counting semaphore
benoitc Jan 6, 2026
90075db
refactor: simplify pool to TCP connection store
benoitc Jan 6, 2026
9866661
feat: add SSL upgrade capability to hackney_conn
benoitc Jan 6, 2026
d681cf7
feat: integrate load regulation in request flow
benoitc Jan 6, 2026
168b163
feat: add connection prewarm to pool
benoitc Jan 6, 2026
836f70b
fix: resolve deadlock in sync checkin when connection calls pool
benoitc Jan 6, 2026
b171174
fix: use async stop for SSL connections during sync checkin
benoitc Jan 6, 2026
f0e5b71
feat: add host_stats/3 for per-host connection statistics
benoitc Jan 6, 2026
963ffdc
fix: trigger prewarm for TCP connections after SSL checkin
benoitc Jan 6, 2026
4231f58
docs: add design guide and update migration documentation
benoitc Jan 6, 2026
96d76e4
feat: vendor HTTP/2 frame and HPACK modules from cowlib
benoitc Jan 6, 2026
a5a14e3
feat: vendor HTTP/2 state machine module from cowlib
benoitc Jan 6, 2026
796f044
feat: add ALPN negotiation support for HTTP/2
benoitc Jan 6, 2026
e71e699
feat: add HTTP/2 connection state to hackney_conn
benoitc Jan 6, 2026
ce82dfc
feat: add HTTP/2 request sending and timer management
benoitc Jan 6, 2026
498bedc
feat: add HTTP/2 flow control and server push support
benoitc Jan 6, 2026
3a92dad
feat: add HTTP/2 connection pooling and high-level API integration
benoitc Jan 6, 2026
60e80f9
feat: add protocols option for ALPN protocol selection
benoitc Jan 6, 2026
6edcb13
docs: update HTTP/2 demo to show protocols option
benoitc Jan 6, 2026
76aeb31
fix: update request/5,6 spec to include HTTP/2 4-tuple return type
benoitc Jan 6, 2026
a6dc8af
docs: add HTTP/2 documentation
benoitc Jan 6, 2026
30154ae
fix: escape code example in alpn_opts doc for edoc XML parser
benoitc Jan 6, 2026
717e7df
fix: add missing HTTP/2 connection multiplexing patch
benoitc Jan 6, 2026
7f48716
docs: HTTP/2 multiplexing docs and tests
benoitc Jan 6, 2026
1ad8d3c
feat: respect protocols option, add fallback tests
benoitc Jan 6, 2026
ccc3b10
feat: add HTTP/3 build infrastructure
benoitc Jan 6, 2026
b4c92db
feat: implement QUIC connection using lsquic
benoitc Jan 6, 2026
d111960
test: add QUIC/HTTP3 connection tests
benoitc Jan 6, 2026
59a394e
feat: implement stream operations for QUIC
benoitc Jan 6, 2026
ecd24d5
feat: implement HTTP/3 header sending via lsquic
benoitc Jan 6, 2026
0334af2
feat: add HTTP/3 high-level API and UDP happy eyeballs
benoitc Jan 6, 2026
1d452ca
feat: integrate HTTP/3 with hackney_conn state machine
benoitc Jan 6, 2026
835f3f6
fix: HTTP/3 response delivery and add full request/response test
benoitc Jan 6, 2026
6f94dd2
test: add HTTP/3 connection tests via hackney_conn
benoitc Jan 7, 2026
432035f
feat: add HTTP/3 connection pooling (multiplexed)
benoitc Jan 7, 2026
408e5fe
feat: add Alt-Svc header parsing and caching for HTTP/3 discovery
benoitc Jan 7, 2026
8d13756
feat: integrate HTTP/3 into hackney API with protocol selection
benoitc Jan 7, 2026
dcbe4e3
docs: add HTTP/3 guide
benoitc Jan 7, 2026
14674d9
feat: add HTTP/3 async response streaming
benoitc Jan 7, 2026
d0d7ef3
feat: add HTTP/3 stream_body support for pull-based streaming
benoitc Jan 7, 2026
ca748ae
feat: add HTTP/3 streaming body uploads
benoitc Jan 7, 2026
80bcd7d
refactor: improve C code safety in QUIC NIF
benoitc Jan 7, 2026
470e409
docs: add HTTP/3 to changelog and update NOTICE
benoitc Jan 7, 2026
9e4dc29
feat: add global default_protocols configuration
benoitc Jan 7, 2026
2bf0919
feat: vendor lsquic and boringssl for HTTP/3 support
benoitc Jan 7, 2026
147dbae
fix: add GCC compatibility for BoringSSL __has_feature macro
benoitc Jan 7, 2026
7daa0ea
build: use C17 and C++20 standards
benoitc Jan 7, 2026
1a66ae3
fix: resolve multiple definition errors and add -fPIC for shared library
benoitc Jan 7, 2026
ad39924
fix: resolve compiler warnings in QUIC NIF
benoitc Jan 7, 2026
e510b6d
ci: add go to FreeBSD package list for BoringSSL build
benoitc Jan 7, 2026
41848a2
fix: use header file for GCC __has_feature compatibility
benoitc Jan 7, 2026
df38c60
improvements
benoitc Jan 7, 2026
4bce0f3
ci: fix build issues and drop legacy OTP support
benoitc Jan 7, 2026
df9f029
chore: update BoringSSL to 0.20251124.0
benoitc Jan 7, 2026
d89c48c
fix: use C++ linker for NIF to fix segfault with new BoringSSL
benoitc Jan 7, 2026
e55f013
ci: remove disabled linux-quic job
benoitc Jan 7, 2026
4de373c
ci: use LLVM 18 on FreeBSD for C++20 support
benoitc Jan 7, 2026
fd69cc0
fix: race conditions and memory management in QUIC NIF
benoitc Jan 7, 2026
bf444fd
refactor: QUIC NIF event-driven architecture with dirty schedulers
benoitc Jan 7, 2026
01e5ce2
docs: add HTTP/3 support to Why hackney section
benoitc Jan 7, 2026
c127b87
fix: validate connection state on pool checkout for HTTP/2 and HTTP/3
benoitc Jan 7, 2026
dc7cc9f
release: prepare 2.0.0-beta.1
benoitc Jan 7, 2026
6038384
docs: add contributing guide
benoitc Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
95 changes: 77 additions & 18 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,113 @@ on:
pull_request:
branches:
- master

permissions:
contents: read

jobs:
ci:
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
runs-on: ${{matrix.os}}
# Linux x86_64 - main CI
linux:
name: Linux x86_64 OTP-${{matrix.otp}}
runs-on: ubuntu-latest
strategy:
matrix:
otp: ["27.3", "28.0"]
rebar3: ['3.25.0']
os: [ubuntu-22.04]
otp: ["27.2", "28.0"]
rebar3: ['3.24.0']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: python3 python3-httpbin python3-pip
packages: python3 python3-httpbin python3-pip cmake golang
version: 1.1
- run: |
pip3 install gunicorn
gunicorn -b 127.0.0.1:8000 -b unix:httpbin.sock httpbin:app&
- run: rebar3 xref
- run: rebar3 eunit
- run: rebar3 dialyzer
legacy:
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
runs-on: ${{matrix.os}}

# Linux ARM64
linux-arm64:
name: Linux ARM64 OTP-${{matrix.otp}}
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ["24.3", "25.3", "26.2"]
rebar3: ['3.22.1']
os: [ubuntu-22.04]
otp: ["27.2"]
rebar3: ['3.24.0']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: python3 python3-httpbin python3-pip
packages: cmake golang
version: 1.1
- run: |
pip3 install gunicorn
gunicorn -b 127.0.0.1:8000 -b unix:httpbin.sock httpbin:app&
- run: rebar3 xref
- run: rebar3 eunit
- run: rebar3 dialyzer

# macOS ARM64 (Apple Silicon)
macos:
name: macOS ARM64 OTP-${{matrix.otp}}
runs-on: macos-15
strategy:
matrix:
otp: ["27"]
rebar3: ['3.24.0']
steps:
- name: Install Erlang and Go
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew update
brew install erlang@${{ matrix.otp }} go
echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
- name: Install rebar3
run: |
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
- uses: actions/checkout@v4
with:
submodules: recursive
- run: make test

# FreeBSD
freebsd:
name: FreeBSD 14.2 OTP-28
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Test on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
release: "14.2"
usesh: true
prepare: |
pkg install -y erlang-runtime28 rebar3 cmake git gmake go llvm18
run: |
# Ensure Erlang 28 is in PATH
export PATH="/usr/local/lib/erlang28/bin:$PATH"
echo "Erlang version:"
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
echo "Architecture:"
uname -m
# Use LLVM 18 clang which fully supports C++20
export CC=/usr/local/bin/clang18
export CXX=/usr/local/bin/clang++18
echo "Using CC=$CC CXX=$CXX"
$CXX --version
git config --global --add safe.directory $GITHUB_WORKSPACE
rebar3 eunit

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ mime.types
*.plt
*_plt
rebar3.crashdump
.aider*
doc/
priv/*.so
priv/*.dll
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Contributing to hackney

Thank you for your interest in contributing to hackney!

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/hackney.git`
3. Create a branch: `git checkout -b my-feature`
4. Make your changes
5. Run tests: `rebar3 eunit`
6. Push and open a pull request

## Pull Request Guidelines

### Title Format

We use [Conventional Commits](https://www.conventionalcommits.org/) for PR titles:

```
<type>: <description>
```

**Types:**

| Type | Description |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation only |
| `refactor` | Code change that neither fixes a bug nor adds a feature |
| `perf` | Performance improvement |
| `test` | Adding or updating tests |
| `chore` | Maintenance tasks, dependencies |
| `security` | Security fix |

**Examples:**

- `feat: add HTTP/3 connection pooling`
- `fix: handle timeout in async responses`
- `docs: update WebSocket guide`
- `refactor: simplify connection state machine`
- `perf: reduce memory allocation in header parsing`
- `security: update SSL certificate bundle`

### Description

Include in your PR description:

- **What** the change does
- **Why** the change is needed
- **How** to test it (if applicable)

## Development Setup

### Requirements

- Erlang/OTP 27+
- rebar3

### Building

```sh
rebar3 compile
```

### Building with QUIC support

QUIC/HTTP3 requires lsquic and BoringSSL (vendored in `c_src/`):

```sh
HACKNEY_QUIC_OPTS="-DCMAKE_BUILD_TYPE=Release" rebar3 compile
```

### Running Tests

```sh
# All tests
rebar3 eunit

# Specific test module
rebar3 eunit --module=hackney_conn_tests

# With verbose output
rebar3 eunit --verbose
```

### Running Dialyzer

```sh
rebar3 dialyzer
```

## Code Style

- Follow existing code conventions
- Keep functions short and focused
- Add specs for exported functions
- Update documentation for API changes

## Reporting Issues

When reporting bugs, include:

- Erlang/OTP version (`erl -version`)
- hackney version
- Minimal reproduction case
- Expected vs actual behavior

## Questions?

Open an issue or reach out to the maintainers.
Loading
Loading