Expand description
Rate limiting middleware for HTTP requests
This module provides rate limiting functionality using the tower-governor crate, which implements the Generic Cell Rate Algorithm (GCRA). Rate limits can be configured globally and are tracked per client IP address.
Structsยง
- Governor
Config Builder - Helper struct for building a configuration for the governor middleware.
- Governor
Layer - The Layer type that implements tower::Layer and is passed into
.layer() - Rate
Limit Config - Rate limiting configuration
- Smart
IpKey Extractor - A [KeyExtractor] that tries to get the client IP address from the x-forwarded-for, x-real-ip, and forwarded headers in that order. Falls back to the peer IP address.