Networking
CHTTPServer
Serve files from a document root with configurable request handling.
C++23
mc/CHTTPServer.h
#include <mc/CHTTPServer.h>Copy
Construct from a configuration map. Common keys are root, host, port, runExecutables, readTimeoutSecs, and writeTimeoutSecs.
For a static file server, set runExecutables to false. Set host explicitly when the listener should be restricted to loopback.
Jump to a declaration · 6
CHTTPServer
Methods
Copies the server configuration and prepares its resources. Call start() to begin serving and shutdown() to stop; construction alone does not enter the request loop.
Starts serving; binds synchronously so startup failures are reported to the caller.
Stops listening and shuts down request processing.