Config¶
-
namespace HTTPServer¶
-
class Config¶
Public Static Functions
-
static void initDefault()¶
-
static void initFromFile(const std::string &path)¶
-
static const ServerConfig &get()¶
Private Static Attributes
-
static ServerConfig d_config = {}¶
-
static void initDefault()¶
-
struct ServerConfig¶
Public Members
-
bool kEnableHttps = false¶
Https
-
std::string kCertFile = {}¶
-
std::string kKeyFile = {}¶
-
bool kEnableHttpRedirection = false¶
-
std::chrono::seconds kCleanupInterval = {600}¶
Periodic Idle IP Cleanup
-
std::chrono::seconds kIdleTimeout = {300}¶
-
int kClientTimeoutSec = 5¶
Networking
-
int kMaxRequestDurationSec = 30¶
-
int kRecvBufferSize = 4096¶
-
size_t kMinThreads = 4¶
Threading
-
size_t kMaxThreads = 32¶
-
int kMaxQueueSize = 1024¶
-
int kMaxConnectionsPerIp = 10¶
Rate Limiting
-
int kMaxKeepAliveRequests = 100¶
-
double kMaxTokens = 10.0¶
-
double kRefillRate = 5.0¶
-
int kMaxHeaderBytes = 16 * 1024¶
HTTP Limits
-
int kMaxHeaderCount = 100¶
-
int kMaxTotalHeaderSize = 64 * 1024¶
-
int kMaxBodyBytes = 10 * 1024 * 1024¶
-
std::unordered_set<std::string> kAllowedMethods = {"GET", "POST",}¶
-
std::unordered_set<std::string> kAllowedVersions = {"HTTP/1.0", "HTTP/1.1",}¶
-
bool kFileLoggingEnabled = false¶
-
std::string kFileLoggingPath = {}¶
-
bool kEnableHttps = false¶
-
class Config¶