A C++11 single-file header-only HTTP/HTTPS server and client library for building web services and clients.
cpp-httplib is a C++11 header-only library that provides both HTTP server and client functionality in a single file. It enables developers to quickly embed web server capabilities into applications or create HTTP clients for consuming APIs, with built-in support for SSL/TLS, WebSocket, and static file serving.
C++ developers building embedded web services, local APIs, IoT applications, or lightweight HTTP clients who prefer a simple, dependency-minimal solution over larger frameworks.
Developers choose cpp-httplib for its zero-configuration integration, comprehensive feature set including SSL and real-time protocols, and the convenience of a single-header library that works across platforms without complex build systems.
A C++ header-only HTTP/HTTPS server and client library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Just include httplib.h to add HTTP capabilities, eliminating complex build dependencies and linking steps, as highlighted in the README's simple examples.
Supports SSL/TLS with OpenSSL, MbedTLS, or wolfSSL backends, plus WebSocket and Server-Sent Events for real-time communication, all documented with code snippets.
Offers configurable static file serving with MIME type mappings and path sanitization, reducing boilerplate code for serving web assets.
Works on Linux, macOS, and Windows with automatic OS certificate store integration, though Windows users should use 127.0.0.1 over localhost for performance.
Uses blocking socket operations, limiting scalability for high-concurrency scenarios compared to asynchronous libraries; the README explicitly warns this isn't for non-blocking I/O.
Officially unsupported on 32-bit platforms with potential security vulnerabilities; the maintainer states security reports for 32-bit will be closed without action.
Static file server methods are marked as not thread-safe in the README, requiring careful synchronization in multi-threaded environments.