Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::adapters::http::HttpAdapterConfig Struct Reference

Configuration for HttpAdapter. More...

#include <http_config.hpp>

Public Attributes

std::string host {"127.0.0.1"}
 Bind address.
std::uint16_t port {9090}
 TCP port.
std::string api_prefix {"/aria"}
 Path prefix for REST endpoints.
std::string static_root {}
 Optional static-file root.
int worker_threads {0}
 Worker thread count for the HTTP server.
int heartbeat_sec {25}
 Heartbeat interval (seconds) for SSE keep-alive pings.
int max_sse_clients {64}
 Maximum number of concurrent SSE clients.
std::size_t max_pending_sse_bytes {4 * 1024 * 1024}
 Maximum queued SSE bytes per client (must be positive), excluding the single frame currently being written to its socket.
std::size_t max_pending_notifications {1024}
 Maximum queued state/click notification batches (must be positive).
bool enable_cors {false}
 Enable CORS headers (Access-Control-Allow-Origin: *).
std::string tls_cert_file {}
 Server certificate (PEM).
std::string tls_key_file {}
 Server private key (PEM). Empty = no TLS.
std::string tls_ca_file {}
 Optional CA bundle for verifying client certificates (mTLS).
std::string tls_min_version {"1.2"}
 Minimum TLS version: "1.2" (default, broad compat) or "1.3" (modern, recommended for new deployments).

Detailed Description

Configuration for HttpAdapter.

All fields have safe defaults; the canonical "just works" instance is HttpAdapterConfig{}.

Member Data Documentation

◆ host

std::string aria::adapters::http::HttpAdapterConfig::host {"127.0.0.1"}

Bind address.

Default "127.0.0.1" — localhost-only for safety. Use "0.0.0.0" to expose on all interfaces (only do this if you have authentication / a reverse proxy in front).

◆ port

std::uint16_t aria::adapters::http::HttpAdapterConfig::port {9090}

TCP port.

0 lets the OS pick — read it back via HttpAdapter::actual_port() after start().

◆ api_prefix

std::string aria::adapters::http::HttpAdapterConfig::api_prefix {"/aria"}

Path prefix for REST endpoints.

Default "/aria". The SSE stream is mounted at <api_prefix>/stream.

◆ static_root

std::string aria::adapters::http::HttpAdapterConfig::static_root {}

Optional static-file root.

When non-empty, the adapter serves HTML/JS/CSS at "/" — convenient for shipping the bundled web SDK

  • an index.html in the same process.

◆ worker_threads

int aria::adapters::http::HttpAdapterConfig::worker_threads {0}

Worker thread count for the HTTP server.

0 = max(2, hardware_concurrency()); explicit counts must be >= 2. The pool is fixed; one worker is reserved from SSE admission.

◆ heartbeat_sec

int aria::adapters::http::HttpAdapterConfig::heartbeat_sec {25}

Heartbeat interval (seconds) for SSE keep-alive pings.

Most reverse proxies idle-close at 30~60s; keep below.

◆ max_sse_clients

int aria::adapters::http::HttpAdapterConfig::max_sse_clients {64}

Maximum number of concurrent SSE clients.

Excess connections receive 503 until existing ones drop. The effective limit is also capped at worker_threads - 1. 0 removes only this additional limit.

◆ max_pending_sse_bytes

std::size_t aria::adapters::http::HttpAdapterConfig::max_pending_sse_bytes {4 * 1024 * 1024}

Maximum queued SSE bytes per client (must be positive), excluding the single frame currently being written to its socket.

Overflow closes that slow client; EventSource reconnects and receives a fresh snapshot. The complete initial snapshot must fit, otherwise /stream returns 503.

◆ max_pending_notifications

std::size_t aria::adapters::http::HttpAdapterConfig::max_pending_notifications {1024}

Maximum queued state/click notification batches (must be positive).

A slow callback does not permit unbounded queued input: further requests receive 503 before changing shadow state or emitting SSE.

◆ enable_cors

bool aria::adapters::http::HttpAdapterConfig::enable_cors {false}

Enable CORS headers (Access-Control-Allow-Origin: *).

Default false. Enable only for development; for production, set up a reverse proxy with proper CORS policy.

◆ tls_cert_file

std::string aria::adapters::http::HttpAdapterConfig::tls_cert_file {}

Server certificate (PEM).

Set both cert/key or neither; TLS configuration is rejected when the adapter was built without TLS.

◆ tls_key_file

std::string aria::adapters::http::HttpAdapterConfig::tls_key_file {}

Server private key (PEM). Empty = no TLS.

◆ tls_ca_file

std::string aria::adapters::http::HttpAdapterConfig::tls_ca_file {}

Optional CA bundle for verifying client certificates (mTLS).

Empty = no client cert required.

◆ tls_min_version

std::string aria::adapters::http::HttpAdapterConfig::tls_min_version {"1.2"}

Minimum TLS version: "1.2" (default, broad compat) or "1.3" (modern, recommended for new deployments).

TLS 1.0/1.1 are never accepted regardless of this setting.


The documentation for this struct was generated from the following file: