idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::http::server::config Struct Reference

HTTP server configuration. More...

#include <idfxx_http_server/include/idfxx/http/server.hpp>

Public Attributes

task_priority priority = 5
 Priority of the server task.
 
size_t stack_size = 4096
 Stack size for the server task.
 
std::optional< core_idcore_affinity = std::nullopt
 Core pin (nullopt = any core)
 
uint16_t server_port = 80
 HTTP listening port.
 
uint16_t ctrl_port = 32768
 Control port for server commands.
 
uint16_t backlog_conn = 5
 Maximum backlog connections.
 
uint16_t max_open_sockets = 7
 Maximum concurrent client connections.
 
uint16_t max_uri_handlers = 8
 Maximum registered URI handlers.
 
uint16_t max_resp_headers = 8
 Maximum additional response headers.
 
size_t max_req_hdr_len = 0
 Maximum request header length (0 = Kconfig default)
 
size_t max_uri_len = 0
 Maximum URI length (0 = Kconfig default)
 
std::chrono::seconds recv_wait_timeout {5}
 Receive timeout.
 
std::chrono::seconds send_wait_timeout {5}
 Send timeout.
 
bool lru_purge_enable = false
 Purge least-recently-used connections when full.
 
bool enable_so_linger = false
 Enable SO_LINGER on sockets.
 
std::chrono::seconds linger_timeout {0}
 Linger timeout.
 
bool keep_alive_enable = false
 Enable TCP keep-alive.
 
std::chrono::seconds keep_alive_idle {0}
 Keep-alive idle time.
 
std::chrono::seconds keep_alive_interval {0}
 Keep-alive probe interval.
 
int keep_alive_count = 0
 Keep-alive probe count.
 
bool wildcard_uri_match = false
 Enable wildcard URI matching.
 
std::move_only_function< result< void >(int) conston_session_open = {}
 Called when a new session is opened.
 
std::move_only_function< void(int) conston_session_close = {}
 Called when a session is closed.
 

Detailed Description

HTTP server configuration.

Note
If adding or modifying fields, mirror the changes in ssl_server::config. The fields are intentionally duplicated (not inherited) to preserve C++20 designated initializer support.

Definition at line 518 of file server.hpp.

Member Data Documentation

◆ backlog_conn

uint16_t idfxx::http::server::config::backlog_conn = 5

Maximum backlog connections.

Definition at line 527 of file server.hpp.

◆ core_affinity

std::optional<core_id> idfxx::http::server::config::core_affinity = std::nullopt

Core pin (nullopt = any core)

Definition at line 522 of file server.hpp.

◆ ctrl_port

uint16_t idfxx::http::server::config::ctrl_port = 32768

Control port for server commands.

Definition at line 526 of file server.hpp.

◆ enable_so_linger

bool idfxx::http::server::config::enable_so_linger = false

Enable SO_LINGER on sockets.

Definition at line 544 of file server.hpp.

◆ keep_alive_count

int idfxx::http::server::config::keep_alive_count = 0

Keep-alive probe count.

Definition at line 551 of file server.hpp.

◆ keep_alive_enable

bool idfxx::http::server::config::keep_alive_enable = false

Enable TCP keep-alive.

Definition at line 548 of file server.hpp.

◆ keep_alive_idle

std::chrono::seconds idfxx::http::server::config::keep_alive_idle {0}

Keep-alive idle time.

Definition at line 549 of file server.hpp.

◆ keep_alive_interval

std::chrono::seconds idfxx::http::server::config::keep_alive_interval {0}

Keep-alive probe interval.

Definition at line 550 of file server.hpp.

◆ linger_timeout

std::chrono::seconds idfxx::http::server::config::linger_timeout {0}

Linger timeout.

Definition at line 545 of file server.hpp.

◆ lru_purge_enable

bool idfxx::http::server::config::lru_purge_enable = false

Purge least-recently-used connections when full.

Definition at line 541 of file server.hpp.

◆ max_open_sockets

uint16_t idfxx::http::server::config::max_open_sockets = 7

Maximum concurrent client connections.

Definition at line 530 of file server.hpp.

◆ max_req_hdr_len

size_t idfxx::http::server::config::max_req_hdr_len = 0

Maximum request header length (0 = Kconfig default)

Definition at line 533 of file server.hpp.

◆ max_resp_headers

uint16_t idfxx::http::server::config::max_resp_headers = 8

Maximum additional response headers.

Definition at line 532 of file server.hpp.

◆ max_uri_handlers

uint16_t idfxx::http::server::config::max_uri_handlers = 8

Maximum registered URI handlers.

Definition at line 531 of file server.hpp.

◆ max_uri_len

size_t idfxx::http::server::config::max_uri_len = 0

Maximum URI length (0 = Kconfig default)

Definition at line 534 of file server.hpp.

◆ on_session_close

std::move_only_function<void(int) const> idfxx::http::server::config::on_session_close = {}

Called when a session is closed.

Definition at line 560 of file server.hpp.

◆ on_session_open

std::move_only_function<result<void>(int) const> idfxx::http::server::config::on_session_open = {}

Called when a new session is opened.

Return an error to reject.

Definition at line 558 of file server.hpp.

◆ priority

task_priority idfxx::http::server::config::priority = 5

Priority of the server task.

Definition at line 520 of file server.hpp.

◆ recv_wait_timeout

std::chrono::seconds idfxx::http::server::config::recv_wait_timeout {5}

Receive timeout.

Definition at line 537 of file server.hpp.

◆ send_wait_timeout

std::chrono::seconds idfxx::http::server::config::send_wait_timeout {5}

Send timeout.

Definition at line 538 of file server.hpp.

◆ server_port

uint16_t idfxx::http::server::config::server_port = 80

HTTP listening port.

Definition at line 525 of file server.hpp.

◆ stack_size

size_t idfxx::http::server::config::stack_size = 4096

Stack size for the server task.

Definition at line 521 of file server.hpp.

◆ wildcard_uri_match

bool idfxx::http::server::config::wildcard_uri_match = false

Enable wildcard URI matching.

Definition at line 554 of file server.hpp.


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