66 releases (29 breaking)

new 0.67.0 Apr 8, 2024
0.66.2 Mar 6, 2024
0.66.1 Feb 28, 2024
0.63.1 Dec 21, 2023
0.37.6 Nov 29, 2022

#1252 in HTTP server

Download history 305/week @ 2023-12-22 256/week @ 2023-12-29 328/week @ 2024-01-05 407/week @ 2024-01-12 342/week @ 2024-01-19 364/week @ 2024-01-26 339/week @ 2024-02-02 452/week @ 2024-02-09 746/week @ 2024-02-16 903/week @ 2024-02-23 1119/week @ 2024-03-01 1863/week @ 2024-03-08 785/week @ 2024-03-15 637/week @ 2024-03-22 814/week @ 2024-03-29 756/week @ 2024-04-05

3,130 downloads per month
Used in salvo

MIT/Apache

665KB
15K SLoC

salvo-rate-limiter

Rate limit for Salvo.

This is offical crate, so you can enable it in Cargo.toml like this:

salvo = { version = "*", features=["rate-limiter"] }

Documentation & Resources


lib.rs:

Rate limiter middleware for Salvo.

Rate Limiter middleware is used to limiting the amount of requests to the server from a particular IP or id within a time period.

RateIssuer is used to issue a key to request, your can define your custom RateIssuer. If you want just identify user by IP address, you can use RemoteIpIssuer.

QuotaGetter is used to get quota for every key.

RateGuard is strategy to verify is the request exceeded quota.

Read more: https://salvo.rs

Dependencies

~19–37MB
~617K SLoC