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 are
keyed on the real TCP peer IP (PeerIpKeyExtractor) rather than the
spoofable X-Forwarded-For family of headers, so a client cannot evade the
limit or exhaust another client’s bucket by forging a forwarding header.
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() - Peer
IpKey Extractor - A [KeyExtractor] that uses peer IP as key. This is the default key extractor and it may no do want you want.
- Rate
Limit Config - Rate limiting configuration