ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
http_server.h File Reference

Minimal single-threaded HTTP/1.1 server. More...

Go to the source code of this file.

Data Structures

struct  ascii_query::HttpRequest
 Parsed HTTP request. More...
 
struct  ascii_query::HttpResponse
 HTTP response builder. More...
 
class  ascii_query::HttpServer
 Simple single-threaded HTTP server. More...
 

Namespaces

namespace  ascii_query
 

Typedefs

using ascii_query::RouteHandler = std::function< HttpResponse(const HttpRequest &)>
 Route handler function type.
 

Detailed Description

Minimal single-threaded HTTP/1.1 server.

This provides a simple HTTP server for the query tool. It's designed to be:

  • Single-threaded (request handlers block)
  • Synchronous (one request at a time)
  • Minimal (no external dependencies)

Usage: HttpServer server; server.addRoute("GET", "/", [](const HttpRequest& req) { return HttpResponse::ok("text/html", "<h1>Hello</h1>"); }); server.start(9999); // ... later ... server.stop();

Definition in file http_server.h.