Fast and versatile web framework in modern C++
Webserver is a lightweight, high-performance framework built on top of Uvent.
It provides everything you need to handle HTTP/1.0 and HTTP/1.1 efficiently, with planned support for HTTP/2 and HTTP/3.
- 🚀 High-performance async event loop (via Uvent)
- 📦 RFC-compliant HTTP parser
- 🔌 Middleware and routing system (regex & radix)
- 🧩 Modular and extensible design
- 🔒 TLS/SSL support (optional, OpenSSL)
Minimal server:
#include "server/server.h"
#include "Protocols/HTTP/Message.h"
using namespace usub::server;
void handler(protocols::http::Request &req, protocols::http::Response &res) {
res.setStatus(200).setMessage("OK").setBody("Hello World!\n");
}
int main() {
Server server("../config/config.toml");
server.handle({"GET"}, "/hello", handler);
server.run();
}
Run:
curl http://127.0.0.1:8111/hello
Full documentation:
See Roadmap.
We welcome contributions! Please see the Contributing Guide.
MIT