cppnet/Overview
cppnet
A modular C++ networking library for building HTTP servers that speak JSON and Protobuf, with a layered parser, router, and handler design.
cppnet is a C++ networking library for building servers that handle both
JSON and Protobuf payloads. It follows a layered architecture — parsing,
routing, and business-logic handling — so you wire up endpoints by mapping HTTP
methods and paths to typed handlers.
Architecture at a glance
The library is organized into clear layers:
- Parsing layer — parses incoming HTTP requests (built on
llhttp). - Routing layer — directs requests to the right handler.
- Business-logic handling layer — your handlers for each endpoint.
- Socket layer — manages network I/O. This layer is intentionally left for you to implement (e.g. with Asio) and is not yet provided.
What it gives you
- JSON & Protobuf support for request/response payloads.
- An
llhttp-based parser that populates a typedRequestobject (method, path, headers, query params, body). - A
Routerwith efficientRouteKeylookups over anunordered_map. - A
BaseHandlerinterface so each endpoint is a small, testable class. - A documented request lifecycle and a test suite covering the parser and handlers.
Status — bring your own socket layer
cppnet is alpha. The parser, router, and handler layers work and are
tested, but the socket layer is not yet implemented — you must provide it
(for example with Asio) to run a live server. See the
roadmap.
Where to next
- New here? Start with Installation and the Quickstart.
- Understand the design in Architecture and the Request lifecycle.
- Add an endpoint in Handlers & routing.