Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Rate Limiting System

Hierarchical rate limiting with GCRA algorithm for DDOS protection. Supports multiple address levels (IPv4 /32, /24; IPv6 /128, /64, /48) and includes proof-of-work counter for CONN action abuse prevention.

Structs§

BanEntry
Ban entry stored in the ban list
PowConfig
Proof-of-Work counter configuration
RateLimitConfig
Main rate limit configuration
RateLimitLayer
Rate limit middleware layer
RateLimitManager
Main rate limit manager
RateLimitStatus
Current status of rate limiting for an address at a specific level
RateLimitTierConfig
Dual-tier rate limit configuration for a single address level
RateLimiterStats
Statistics about the rate limiter

Enums§

AddressKey
Represents the hierarchical address level being limited
PenaltyReason
Reason for a penalty
PowError
Proof-of-work error types
PowPenaltyReason
Reason for incrementing the PoW counter
RateLimitError
Rate limit error types

Traits§

RateLimitApi
Internal API for programmatic rate limit management

Functions§

extract_client_ip
Extract client IP from request based on ServerMode