A single-header C library for building event-driven, non-blocking HTTP servers with support for epoll and kqueue.
httpserver.h is a single-header C library for creating event-driven, non-blocking HTTP servers. It solves the need for lightweight, high-performance server implementations in C, providing a minimal API that leverages epoll on Linux and kqueue on BSD/macOS for efficient I/O handling.
C developers building custom HTTP servers, embedded systems engineers needing lightweight networking solutions, and programmers who require high-performance, non-blocking I/O without external dependencies.
Developers choose httpserver.h for its simplicity, portability, and performance—it offers a dependency-free, single-file solution that outperforms many heavier alternatives in micro-benchmarks while maintaining a clean, straightforward API.
Single header library for writing non-blocking HTTP servers in C
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Easy to integrate into C projects without dependencies or complex build systems—just include the header file with HTTPSERVER_IMPL defined, as shown in the example.
Benchmarks in the README show it outperforms NGINX in simple scenarios, achieving over 120k requests/sec with keep-alive, making it ideal for low-latency applications.
Uses epoll on Linux and kqueue on BSD/macOS for non-blocking I/O, enabling scalable handling of concurrent connections with minimal resource usage.
Supports major Unix-like operating systems with native event notification systems, ensuring portability without sacrificing performance.
API documentation is only provided in the header file, which lacks tutorials, detailed examples, or guidance beyond a basic snippet, making it harder for newcomers.
Missing TLS/SSL support, requiring developers to manually integrate encryption libraries like OpenSSL for secure HTTP, which adds complexity and potential vulnerabilities.
Only provides basic HTTP server functionality—no built-in routing, middleware, logging, or advanced features like compression, forcing developers to implement these from scratch.