davidmoreno/onion
FreeC library to create simple HTTP servers and Web Applications.
FreeFree tier
About davidmoreno/onion
Onion is a C library for creating simple HTTP servers and web applications. It is designed to be embedded into existing or new applications that require HTTP interconnection with the outside world. Developers can add handlers for specific URLs and generate dynamic data as needed. The library includes SSL support for secure communications, supports multiple event backends (epoll, libevent, libev), and is dual-licensed under Apache 2.0 and GPLv2+. Onion is not a standalone web server but a library that allows developers to integrate HTTP serving capabilities directly into their C programs. It includes a wiki, API documentation, and a mailing list for community support.
Key Features
C library for embedding HTTP servers into applications
URL handler system for serving dynamic content
SSL/TLS support for secure connections
Multiple event backend support: epoll, libevent, libev
Dual licensed under Apache 2.0 and GPLv2+
Debugging support with environment variables
Pros & Cons
Pros
- Lightweight and embeddable C library
- Flexible handler system for custom URL routing
- SSL support for secure communications out of the box
- Multiple event backends for platform flexibility
- Dual licensing allows use in both open source and commercial projects
Cons
- Requires C programming knowledge to integrate
- Not a standalone server; requires host application
- Documentation may be limited to wiki and API docs
- Primarily targeted at Unix-like systems
Best For
Embedding an HTTP server into an existing C applicationServing dynamic web content from C programsPrototyping web applications in CAdding a REST API to a C-based application
FAQ
What is Onion?
Onion is a C library for creating simple HTTP servers and web applications. It is not a standalone server but a library to add HTTP serving capabilities to existing or new applications.
How do I compile and install Onion?
Clone the repository, create a build directory, run 'cmake ..' followed by 'make' and 'sudo make install'. Dependencies include a C compiler, cmake, and make, plus one of epoll (Linux), libevent, or libev.
What dependencies are required?
Required: C compiler, cmake, make. Also needed: one of epoll (Linux), libevent, or libev for event handling.
Is Onion licensed for commercial use?
Yes, Onion is dual-licensed under Apache 2.0 and GPLv2+, so it can be used in both commercial and free software projects.
Where can I find documentation and community support?
Documentation is available at https://github.com/davidmoreno/onion/wiki and API docs at http://coralbits.com/static/onion/. There is also a mailing list at https://groups.google.com/a/coralbits.com/forum/#!forum/onion-dev.