High performance
Small C runtime with direct control over server behavior.
A fast and simple HTTP server library for C
libchttpx is a compact HTTP/1.1 server library with routing, middleware, JSON helpers, uploads, TLS, compression, built-in metrics and graceful shutdown.
#include <libchttpx.h>
static void health(chttpx_request_t* req,
chttpx_response_t* res)
{
(void)req;
*res = cHTTPX_ResMessage(
cHTTPX_StatusOK, "healthy"
);
}
int main(void)
{
chttpx_app_t app;
cHTTPX_AppInit(&app);
chttpx_config_t config = cHTTPX_DefaultConfig();
config.port = 8080;
chttpx_serv_t* server =
cHTTPX_AppServer(&app, "main", &config);
chttpx_router_t router =
cHTTPX_RoutePathPrefix(server, "");
cHTTPX_Get(&router, "/health", health);
return cHTTPX_AppRun(&app);
}
Small C runtime with direct control over server behavior.
Routing, responses and helpers without repetitive HTTP plumbing.
Middleware, TLS, gzip compression, metrics, JSON, uploads and custom server limits.
Module-by-module documentation and runnable examples.
Read the code, contribute, fork it and build on top of it.
Why libchttpx?
The library is designed so handlers contain application logic instead of repetitive request parsing, response building and server boilerplate.
Read the documentation →Support the project
libchttpx stays open source. Commercial help, integration work and sponsorship are separate ways to support continued development.
Interested in funding features or long-term maintenance?
Sponsor optionsFound a bug or have a feature request? Open it publicly on GitHub.
GitHub Issues ↗Need help with integration, debugging, review or a custom feature?
Contact