63 releases (28 breaking)

new 0.66.0 Feb 15, 2024
0.65.1 Jan 23, 2024
0.63.1 Dec 21, 2023
0.59.0 Nov 30, 2023
0.37.6 Nov 29, 2022

#1052 in HTTP server

Download history 561/week @ 2023-10-29 540/week @ 2023-11-05 629/week @ 2023-11-12 638/week @ 2023-11-19 693/week @ 2023-11-26 852/week @ 2023-12-03 779/week @ 2023-12-10 852/week @ 2023-12-17 876/week @ 2023-12-24 709/week @ 2023-12-31 818/week @ 2024-01-07 925/week @ 2024-01-14 888/week @ 2024-01-21 1030/week @ 2024-01-28 774/week @ 2024-02-04 1154/week @ 2024-02-11

3,963 downloads per month
Used in salvo

MIT/Apache

650KB
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–35MB
~609K SLoC