#http #async #web #framework #server

salvo-rate-limiter

Rate limiter middleware for salvo web server framework

16 releases (5 breaking)

new 0.42.0 May 29, 2023
0.41.1 May 12, 2023
0.40.0 Apr 30, 2023
0.39.1 Apr 28, 2023
0.1.0 Oct 1, 2022

#851 in HTTP server

Download history 492/week @ 2023-02-05 471/week @ 2023-02-12 477/week @ 2023-02-19 244/week @ 2023-02-26 225/week @ 2023-03-05 185/week @ 2023-03-12 202/week @ 2023-03-19 203/week @ 2023-03-26 201/week @ 2023-04-02 191/week @ 2023-04-09 212/week @ 2023-04-16 186/week @ 2023-04-23 242/week @ 2023-04-30 326/week @ 2023-05-07 239/week @ 2023-05-14 235/week @ 2023-05-21

1,072 downloads per month
Used in salvo

MIT/Apache

525KB
12K 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.

Dependencies

~15–25MB
~521K SLoC