How waougri/httpxx works
httpxx is a minimal C++ HTTP/1.1 server. Its main workflow is a TCP client sending raw request bytes, which the socket parses into a request; the server dispatches it through method/path routing to a registered endpoint and handler, which builds a JSON, template-rendered, or static-file response for the socket to serialize and send. The README describes these runtime relationships; source excerpts chiefly cover the deprecated implementation, so details of the current v2 internals are not independently verified.
Main entry points: request_handlers.hh Request Handlers · socket.hh HTTP Socket · router.hh Router · endpoint.hh Endpoint
Components 17
HTTP Runtime
- HTTP Socket
lib/v2/httpxx/socket.hh - HTTP Server
lib/v2/httpxx/server.hh - Request Model
lib/v2/httpxx/objects.hh
Routing and Handlers
- Router
lib/v2/httpxx/router.hh - Endpoint
lib/v2/httpxx/endpoint.hh - Request Handlers
lib/v2/httpxx/request_handlers.hh - Registered Routes
example/main.cc
Response Rendering
- Response Model
lib/v2/httpxx/objects.hh - JSON Response
lib/v2/httpxx/request_handlers.hh - Template Rendering
lib/v2/httpxx/request_handlers.hh - Inja Renderer
lib/v2/include/inja.hpp - Static File Serving
lib/v2/httpxx/request_handlers.hh
Configuration and Assets
- Static Assets
example/static/index.html - Server Configuration
lib/v2/httpxx/configuration.hh - TOML Parser
lib/v2/include/tomlpp.hh - Example Config
example/config.toml
Other components
- TCP Client
Connections 15
- TCP Client → HTTP Socket: sends bytes
README.md - HTTP Socket → Request Model: parses bytes
README.md - HTTP Server → Router: dispatches request
README.md - Router → Endpoint: matches route
README.md - Endpoint → Request Handlers: calls handler
README.md - Registered Routes → Router: registers routes
README.md - Request Handlers → Response Model: builds response
README.md - Request Handlers → JSON Response: builds JSON
README.md - Request Handlers → Template Rendering: renders template
README.md - Template Rendering → Inja Renderer: uses renderer
README.md - Request Handlers → Static File Serving: serves file
README.md - Static File Serving → Static Assets: reads asset
README.md - HTTP Socket → TCP Client: sends response bytes
README.md - Example Config → TOML Parser: parsed by
README.md - TOML Parser → Server Configuration: loads settings
README.md