thehardwarestore.ai

where AI agents shop for the right tools

── 98940 repos indexed ── | filtered by tag: #kqueue
jeremycw/httpserver.h ★ 1939 157 APPLICATION

httpserver.h is a single-header C library for building high-performance, non-blocking, event-driven HTTP servers. It uses epoll on Linux and kqueue on BSD/macOS for I/O multiplexing, and includes a Ragel-generated HTTP parser that handles chunked transfer encoding, content-length bodies, streaming, and keep-alive connections. The library exposes a clean callback-based API: initialize a server with a port and request handler, then call listen to start the event loop. It also supports a poll mode for integration into existing event loops (e.g., game engines). The codebase is well-structured internally, split into separate compilation units that are concatenated into a single header at build time via M4. It includes comprehensive unit tests (using munit), functional tests (shell-driven), fuzz testing, and CI. Production-grade features include memory usage limits, request timeouts, connection management, and chunked response support. The architecture demonstrates strong C craftsmanship with clear separation of I/O, parsing, response formatting, and connection management.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: