|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
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). | |
Configuration for HttpAdapter.
All fields have safe defaults; the canonical "just works" instance is HttpAdapterConfig{}.
| 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).
| 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().
| 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.
| 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
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| std::string aria::adapters::http::HttpAdapterConfig::tls_key_file {} |
Server private key (PEM). Empty = no TLS.
| std::string aria::adapters::http::HttpAdapterConfig::tls_ca_file {} |
Optional CA bundle for verifying client certificates (mTLS).
Empty = no client cert required.
| 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.