A C library for creating simple HTTP servers and web applications, designed to embed web functionality into existing programs.
Onion is a C library for creating HTTP servers and web applications directly within C programs. It solves the problem of adding web interfaces to existing applications by providing a lightweight, embeddable HTTP server with URL routing, templating, and SSL support.
C developers who need to add HTTP server functionality to their applications, such as embedded systems programmers, desktop application developers requiring web interfaces, or those building lightweight web services in C.
Developers choose Onion because it offers a minimal, library-based approach to web serving—avoiding the overhead of a full web server—while providing essential features like SSL, templating, and flexible threading in a cross-platform C library.
C library to create simple HTTP servers and Web Applications.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates directly into C applications as a library, eliminating the need for a separate web server process—ideal for adding web interfaces to existing software without external dependencies.
Uses GnuTLS for encryption with a consistent API, ensuring secure communications even when SSL is optional at compile time, as noted in the README.
Supports single-threaded, per-connection threading, and thread pool modes, allowing performance tuning based on application needs, with benchmarks showing up to 30k requests per second.
Works on Linux, FreeBSD, and Darwin using epoll, libev, or libevent, making it versatile for different environments without major code changes.
Requires manual compilation with cmake and has multiple optional dependencies (e.g., gnutls for SSL, libxml2 for WebDAV), which can complicate installation and reduce out-of-the-box functionality.
Relies on a wiki and mailing list for support, with less comprehensive documentation and a smaller community compared to mainstream web libraries, potentially slowing development.
As a C library, it targets a specific audience, and the README admits binary compatibility breaks (e.g., in version 0.4.0), which can require recompilation and cause maintenance headaches.