Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
orbit::middleware::RateLimitOptions Struct Reference

Settings for the in-memory rate limiter. More...

#include <RateLimiter.hpp>

Public Attributes

size_t max_requests = 100
 Burst size and requests allowed per window.
 
std::chrono::seconds window {60}
 
std::function< std::string(const http::HttpRequest &)> key
 
size_t max_tracked_clients = 100000
 Upper bound on remembered clients.
 

Detailed Description

Settings for the in-memory rate limiter.

Member Data Documentation

◆ key

std::function<std::string(const http::HttpRequest&)> orbit::middleware::RateLimitOptions::key

Identifies the client. Defaults to the socket address (req.client_ip). Behind a reverse proxy you trust, return the address it forwards instead; never trust client-supplied headers otherwise.

◆ max_requests

size_t orbit::middleware::RateLimitOptions::max_requests = 100

Burst size and requests allowed per window.

◆ max_tracked_clients

size_t orbit::middleware::RateLimitOptions::max_tracked_clients = 100000

Upper bound on remembered clients.

◆ window

std::chrono::seconds orbit::middleware::RateLimitOptions::window {60}

Window over which max_requests refill


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