A HTTP implementation suite for the C3 programming language, providing HTTP/1.1, HTTP/2, HTTP/3, and WebSocket support built on top of the c3io library.
- HTTP/1.1 (RFC 9112 compliant)
- Incremental request parsing with streaming support
- Chunked transfer encoding with trailer headers
- Security hardening (request smuggling prevention, bare LF rejection, null byte detection)
- Body validation with configurable size limits (413, 414 status codes)
- HTTP version validation (505 status code)
- HTTP/2 (RFC 9113 compliant)
- Full h2spec conformance (146/146 tests passing)
- HPACK header compression (RFC 7541) with Huffman encoding
- Stream multiplexing and state machine
- Flow control with negative window tracking
- Frame parsing (DATA, HEADERS, SETTINGS, WINDOW_UPDATE, PING, GOAWAY, RST_STREAM, PRIORITY, CONTINUATION)
- Connection preface and SETTINGS exchange
- WebSocket (RFC 6455 compliant)
- Full Autobahn testsuite compliance (517 tests: 515 OK, 2 NON-STRICT)
- Text and binary message support with UTF-8 validation
- Message fragmentation and reassembly
- Control frames (Ping/Pong/Close) with proper handling
- permessage-deflate compression (RFC 7692)
- Connection management with close handshake
- HTTP/3
- c3io - Async I/O library for C3 (imported as
async::*) - libuv - Cross-platform asynchronous I/O
- C3 compiler
The c3io library is included as a git submodule in lib/c3io.c3l.
# Clone with submodules
git clone --recursive https://github.com/tristanperalta/c3web.git
# Or if already cloned, initialize submodules
git submodule update --init --recursive
# Build c3io dependency (if not already built)
cd lib/c3io.c3l && c3c build && cd ../..
# Build the c3web library
c3c build c3webThis creates a static library at build/c3web.a.
# Build and run the echo server
c3c build echo_server
./build/echo_server
# Test the server
curl -v http://localhost:8080/
curl -v -H "X-Custom: test" "http://localhost:8080/test?foo=bar"See examples/README.md for more details.
# Run test suite
c3c test