Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2fad7e4
Merge pull request #53 from netcorelink/feat/fixed-worker-pool
noneandundefined Sep 21, 2026
ea4f90f
feat: establish maintainer runtime quality baseline (#57)
noneandundefined Sep 22, 2026
0daf3fd
perf: resolve medium and low bottlenecks from #56 (#61)
noneandundefined Sep 24, 2026
fbef4be
feat: add internal HTTP/2 transport interface
noneandundefined Sep 24, 2026
e0f7e0a
feat: implement HTTP/2 server and client transport
noneandundefined Sep 24, 2026
4b62a78
fix: send valid HTTP/2 server settings
noneandundefined Sep 24, 2026
9ba3d84
refactor: route socket handling through HTTP/2 transport
noneandundefined Sep 24, 2026
0684d9e
refactor: expose internal HTTP/2 dispatch adapter
noneandundefined Sep 24, 2026
0e5be3f
feat: negotiate HTTP/2 with TLS ALPN
noneandundefined Sep 24, 2026
445458f
refactor: run accepted connections as HTTP/2 sessions
noneandundefined Sep 24, 2026
b4febdc
refactor: use HTTP/2 for remote service calls
noneandundefined Sep 24, 2026
0671f66
build: link nghttp2 for HTTP/2 transport
noneandundefined Sep 24, 2026
da03070
build: install nghttp2 dependencies in container
noneandundefined Sep 24, 2026
e2249d7
ci: install nghttp2 dependencies
noneandundefined Sep 24, 2026
def6170
packaging: build HTTP/2 packages with nghttp2
noneandundefined Sep 24, 2026
3d78db7
packaging: declare nghttp2 runtime dependency
noneandundefined Sep 24, 2026
dfc6500
fix: include stdio for internal dispatch adapter
noneandundefined Sep 24, 2026
5ac95eb
packaging: expose nghttp2 linker dependency
noneandundefined Sep 24, 2026
82c23d5
packaging: expose nghttp2 linker dependency for TLS builds
noneandundefined Sep 24, 2026
4c7b2b9
feat: preserve HTTP/2 request and response headers
noneandundefined Sep 24, 2026
0d4956e
fix: keep idle sockets out of HTTP/2 worker pool
noneandundefined Sep 24, 2026
124307a
test: run server integration suite over HTTP/2
noneandundefined Sep 24, 2026
b7e0eec
test: exercise metrics over HTTP/2
noneandundefined Sep 24, 2026
8bd40e1
test: exercise compression over HTTP/2
noneandundefined Sep 24, 2026
8888429
fix: return HTTP/2 limits cleanly and stabilize response metadata
noneandundefined Sep 24, 2026
bba13a8
refactor: disable legacy connection-level WebSocket upgrade on HTTP/2
noneandundefined Sep 24, 2026
c47d755
docs: describe request protocol without legacy version
noneandundefined Sep 24, 2026
8a9d95a
docs: describe public request protocol as negotiated
noneandundefined Sep 24, 2026
3dd61a6
test: remove legacy protocol fixtures
noneandundefined Sep 24, 2026
3d5f28a
docs: describe HTTP/2 transport
noneandundefined Sep 24, 2026
99a9615
docs: describe HTTP/2 transport in Russian
noneandundefined Sep 24, 2026
6f68ea5
docs: update server HTTP/2 model
noneandundefined Sep 24, 2026
aa4bb35
docs: update Russian server HTTP/2 model
noneandundefined Sep 24, 2026
e1edfee
docs: update CORS example to HTTP/2
noneandundefined Sep 24, 2026
8a5d490
docs: update Russian CORS example to HTTP/2
noneandundefined Sep 24, 2026
e14fcb8
docs: advertise HTTP/2 on documentation site
noneandundefined Sep 24, 2026
531d79f
docs: document nghttp2 build dependency
noneandundefined Sep 24, 2026
460f2f4
docs: document nghttp2 dependency in Russian
noneandundefined Sep 24, 2026
c1ce1d9
test: remove duplicate HTTP/2 IPv6 helper
noneandundefined Sep 24, 2026
be67350
fix: avoid duplicate HTTP/2 representation headers in proxied responses
noneandundefined Sep 24, 2026
b65e268
test: use HTTP/2 status line length in metrics assertions
noneandundefined Sep 24, 2026
70389be
fix: synchronize HTTP/2 shutdown flag access
noneandundefined Sep 24, 2026
f176ced
refactor: refactor arch. code in full project
noneandundefined Sep 24, 2026
45f0a0e
fix: correct TLS client certificate verification expression
noneandundefined Sep 24, 2026
73cc536
Merge pull request #62 from netcorelink/feature/http2
noneandundefined Sep 24, 2026
18f49ed
refactor: drop Windows support (#64)
noneandundefined Sep 26, 2026
1a3b77e
feat: add WebSocket support over HTTP/2 (#65)
noneandundefined Sep 27, 2026
1143fcd
feat: add first-class Server-Sent Events API (#63)
noneandundefined Sep 27, 2026
178f2d1
ci: install nghttp2 for CodeQL build
noneandundefined Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None

ColumnLimit: 150
ColumnLimit: 0

PointerAlignment: Left
SpaceBeforeParens: ControlStatements

SortIncludes: false
SortIncludes: false
MaxEmptyLinesToKeep: 1
SeparateDefinitionBlocks: Always
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ body:
label: Operating system
options:
- Linux
- Windows
- macOS
- Other
validations:
required: true
Expand All @@ -33,7 +31,7 @@ body:
id: compiler
attributes:
label: Compiler
placeholder: gcc 13, MSVC 2022, clang 18, etc.
placeholder: gcc 13, clang 18, etc.
validations:
required: true

Expand Down
12 changes: 6 additions & 6 deletions .github/actions/build-linux-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
bash -euc '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends build-essential libcjson-dev zlib1g-dev
apt-get install -y --no-install-recommends build-essential libcjson-dev zlib1g-dev libnghttp2-dev
make clean
make libchttpx.so
cp libchttpx.so dist/deb/libchttpx.so
Expand All @@ -47,7 +47,7 @@ runs:
-w /work \
fedora:42 \
bash -euc '
dnf install -y gcc make cjson-devel zlib-devel
dnf install -y gcc make cjson-devel zlib-devel libnghttp2-devel
make clean
make libchttpx.so
cp libchttpx.so dist/rpm/libchttpx.so
Expand All @@ -62,7 +62,7 @@ runs:
-w /work \
archlinux:base-devel \
bash -euc '
pacman -Sy --noconfirm cjson zlib
pacman -Sy --noconfirm cjson zlib libnghttp2
make clean
make libchttpx.so
cp libchttpx.so dist/archlinux/libchttpx.so
Expand All @@ -77,7 +77,7 @@ runs:
-w /work \
alpine:3.22 \
sh -euc '
apk add --no-cache build-base cjson-dev zlib-dev
apk add --no-cache build-base cjson-dev zlib-dev nghttp2-dev
make clean
make libchttpx.so
cp libchttpx.so dist/apk/libchttpx.so
Expand Down Expand Up @@ -106,10 +106,10 @@ runs:
"includedir=${prefix}/include",
"",
"Name: libchttpx",
"Description: A compact cross-platform HTTP/1.1 server library for C/C++.",
"Description: A compact cross-platform HTTP/2 server library for C/C++.",
f"Version: {version}",
"Libs: -L${libdir} -lchttpx",
"Libs.private: -lz",
"Libs.private: -lz -lnghttp2",
"Cflags: -I${includedir}/libchttpx",
"",
])
Expand Down
9 changes: 6 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ Use a **conventional commit** title — it becomes the release version on merge:

- [ ] PR title follows the table above
- [ ] Code builds on Linux (`make lin` and `make libchttpx.so`)
- [ ] Code builds on Windows (`make win`) if applicable
- [ ] Source is formatted (`make lin-format` or `clang-format`)
- [ ] README updated if public API or usage changed
- [ ] Code builds on Linux (`make lin`) if applicable
- [ ] Source follows `.clang-format` and keeps logical blocks readable
- [ ] ASan/UBSan pass; TSan passes for concurrency-sensitive changes
- [ ] Parser/network changes include negative-path tests and fuzz coverage where applicable
- [ ] Public API changes document ownership, lifetime, thread-safety, and compatibility impact
- [ ] Documentation is updated when public API or observable behavior changes

## Related issues

Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,11 @@ jobs:
<p align="center">
<img alt="golangci-lint logo" src="https://avatars.githubusercontent.com/u/252895549?s=400&u=6c747c431c2844620af7772fcd716ef423a6ab1d&v=4" height="150" />
<h3 align="center">netcorelink/libchttpx</h3>
<p align="center">A powerful, cross-platform HTTP server library in C/C++ for building full-featured web servers</p>
<p align="center">A powerful HTTP/2 server library in C/C++ for Linux</p>
</p>

---

> :warning: **Warning:** Use the `linux environment` for stable library operation.

## Linux native packages

Download the package for your distribution from this release, then install it with the system package manager:
Expand All @@ -172,7 +170,7 @@ jobs:
sudo dnf install ./libchttpx-dev-*.rpm

# Arch Linux
sudo pacman -U ./libchttpx-dev-*.pkg.tar.zst
sudo pacman -U ./libchttpx-dev_*.pkg.tar.zst

# Alpine Linux
sudo apk add --allow-untrusted ./libchttpx-dev_*.apk
Expand All @@ -184,12 +182,6 @@ jobs:
curl -s https://raw.githubusercontent.com/netcorelink/libchttpx/main/scripts/install.sh | sudo sh
```

## Windows

```powershell
iwr https://raw.githubusercontent.com/netcorelink/libchttpx/main/scripts/install.ps1 -UseBasicParsing | iex
```

- name: Checkout APT repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -264,4 +256,3 @@ jobs:
run: |
set -euo pipefail
gh workflow run pages.yml --ref main

167 changes: 113 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,63 @@ name: CI

on:
push:
branches: [main, master]
branches: [main, master, develop]
pull_request:
branches: [main, master, audit/core-safety-hardening]
branches: [main, master, develop, audit/core-safety-hardening]

permissions:
contents: read

jobs:
style:
name: Format and public naming
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install clang-format
run: sudo apt update && sudo apt install -y clang-format

- name: Check newly maintained runtime sources
run: clang-format --dry-run --Werror src/cHTTPX_worker.c src/cHTTPX_worker.h tests/fuzz_headers.c

- name: Reject legacy result names outside compatibility aliases
shell: bash
run: |
set -euo pipefail
matches="$(grep -R -nE '\\bCHTTPX_(OK|ERR_[A-Z0-9_]+)\\b' src include example tests 2>/dev/null || true)"
matches="$(printf '%s\n' "$matches" | grep -vE '^(src/cHTTPX_serv\.h|include/libchttpx\.h):[0-9]+:#define CHTTPX_(OK|ERR_[A-Z0-9_]+) ' || true)"
if [ -n "$matches" ]; then
echo "Use canonical cHTTPX_OK / cHTTPX_ERR_* result names:"
echo "$matches"
exit 1
fi

static-analysis:
name: Static analysis (cppcheck)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install cppcheck
run: sudo apt update && sudo apt install -y cppcheck

- name: Run cppcheck
run: |
cppcheck \
--enable=warning,performance,portability \
--suppress=missingIncludeSystem \
--inline-suppr \
-I include \
-I src \
--error-exitcode=1 \
src/ include/ example/

build-linux:
name: Build (Linux)
name: Build and test (Linux)
needs: [style, static-analysis]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -20,7 +67,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev clang-format
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev

- name: Build binary
run: make lin
Expand All @@ -34,11 +81,69 @@ jobs:
- name: Run tests
run: make test

- name: Run ASan and UBSan tests
sanitizers:
name: ASan, UBSan and TSan
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev

- name: Run ASan and UBSan
run: make test-sanitize

- name: Run ThreadSanitizer
run: make test-tsan

fuzz-smoke:
name: HTTP parser fuzz smoke
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y clang make libcjson-dev zlib1g-dev libnghttp2-dev

- name: Run fuzz smoke test
run: make test-fuzz

package-smoke:
name: Package validation
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev

- name: Build release archive
run: make lin-lib

- name: Validate archive contents
shell: bash
run: |
set -euo pipefail
test -f libchttpx-dev.tar.gz
tar -tzf libchttpx-dev.tar.gz > /tmp/libchttpx-package-files.txt
grep -q '^libchttpx-dev/include/libchttpx.h$' /tmp/libchttpx-package-files.txt
grep -q '^libchttpx-dev/libchttpx.so$' /tmp/libchttpx-package-files.txt

build-linux-tls:
name: Build + HTTPS integration (Linux, OpenSSL)
needs: style
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -47,7 +152,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev libssl-dev openssl
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev libnghttp2-dev libssl-dev openssl

- name: Build TLS-enabled shared library
run: make TLS=1 libchttpx.so
Expand All @@ -60,6 +165,7 @@ jobs:

build-linux-compression:
name: Response compression integration (Linux, zlib)
needs: style
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -68,7 +174,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev libssl-dev
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev libnghttp2-dev libssl-dev

- name: Build shared library
run: make libchttpx.so
Expand All @@ -83,50 +189,3 @@ jobs:
run: |
make clean
make TLS=1 libchttpx.so

build-windows:
name: Build (Windows)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-zlib

- name: Build
run: mingw32-make win SHELL=cmd

- name: Run tests
run: mingw32-make test-win SHELL=cmd

static-analysis:
name: Static analysis (cppcheck)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install cppcheck
run: sudo apt update && sudo apt install -y cppcheck

- name: Run cppcheck
run: |
cppcheck \
--enable=warning,performance,portability \
--suppress=missingIncludeSystem \
--inline-suppr \
-I include \
-I src \
--error-exitcode=1 \
src/ include/ example/
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc make libcjson-dev zlib1g-dev
sudo apt install -y gcc make libcjson-dev zlib1g-dev libnghttp2-dev

- name: Build
run: make libchttpx.so
Expand Down
Loading
Loading