All Projects → AaronErhardt → actix-governor

AaronErhardt / actix-governor

Licence: GPL-3.0 license
A middleware for actix-web that provides rate-limiting backed by governor.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to actix-governor

ratelimiter
A concurrent rate limiter library for Golang based on Sliding-Window rate limiter algorithm.
Stars: ✭ 218 (+363.83%)
Mutual labels:  rate-limiting
Spring-Boot-Application-Template
Spring Boot Web App, Flyway, MySQL, H2DB, Bootstrap, Thymeleaf, JWT, Swagger, API Rate Limiting, Docker, RBAC, i18n
Stars: ✭ 90 (+91.49%)
Mutual labels:  rate-limiting
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (-34.04%)
Mutual labels:  rate-limiting
roll
RPG dice roller with both Rust CLI and ClojureScript Web interfaces
Stars: ✭ 14 (-70.21%)
Mutual labels:  actix-web
RateLimiting.NET
Rate Limiting (debounce, throttle) for C# Portable Class Library
Stars: ✭ 20 (-57.45%)
Mutual labels:  rate-limiting
gatekeeper
Rate limiting middleware for Vapor 👮
Stars: ✭ 54 (+14.89%)
Mutual labels:  rate-limiting
lemmy-lite
A static, JSless, touch-friendly Lemmy frontend built for legacy web clients and maximum performance
Stars: ✭ 51 (+8.51%)
Mutual labels:  actix-web
python-redis-rate-limit
Python Rate Limiter implemented based on Redis INCR, EXPIRE, EVALSHA and EVAL.
Stars: ✭ 104 (+121.28%)
Mutual labels:  rate-limiting
risso
A comment server written in Rust
Stars: ✭ 16 (-65.96%)
Mutual labels:  actix-web
Abp.AspNetCoreRateLimit
An Abp module helps you control how often your service is used.
Stars: ✭ 19 (-59.57%)
Mutual labels:  rate-limiting
rush
rush.readthedocs.io/en/latest/
Stars: ✭ 42 (-10.64%)
Mutual labels:  rate-limiting
limits
Rate limiting using various strategies and storage backends such as redis & memcached
Stars: ✭ 178 (+278.72%)
Mutual labels:  rate-limiting
crates-io-cn
Source code of crates-io.cn, also tools sets for sync crates.io
Stars: ✭ 20 (-57.45%)
Mutual labels:  actix-web
db wlan manager
Monitors your Wifi to keep you logged in and resets your Wifi, if your data is drained
Stars: ✭ 23 (-51.06%)
Mutual labels:  rate-limiting
FireflySoft.RateLimit
It is a rate limiting library based on .Net standard.
Stars: ✭ 76 (+61.7%)
Mutual labels:  rate-limiting
phalcon-throttler
Phalcon Throttler is a Rate Limiter for the PHP Phalcon Framework.
Stars: ✭ 19 (-59.57%)
Mutual labels:  rate-limiting
mCaptcha
A no-nonsense CAPTCHA system with seamless UX | Backend component
Stars: ✭ 473 (+906.38%)
Mutual labels:  actix-web
freebind
IPv4 and IPv6 address rate limiting evasion tool
Stars: ✭ 88 (+87.23%)
Mutual labels:  rate-limiting
dalted
Image processing web-app for color blindness
Stars: ✭ 17 (-63.83%)
Mutual labels:  actix-web
go-ratelimit
Ratelimit your methods using Redis
Stars: ✭ 37 (-21.28%)
Mutual labels:  rate-limiting

CI Docs crates.io

Actix Governor

A middleware for actix-web that provides rate-limiting backed by governor.

Features:

  • Simple to use
  • High performance
  • Robust yet flexible API

Example

use actix_governor::{Governor, GovernorConfigBuilder};
use actix_web::{web, App, HttpServer, Responder};

async fn index() -> impl Responder {
    "Hello world!"
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    // Allow bursts with up to five requests per IP address
    // and replenishes one element every two seconds
    let governor_conf = GovernorConfigBuilder::default()
        .per_second(2)
        .burst_size(5)
        .finish()
        .unwrap();

    HttpServer::new(move || {
        App::new()
            // Enable Governor middleware
            .wrap(Governor::new(&governor_conf))
            // Route hello world service
            .route("/", web::get().to(index))
    })
    .bind("127.0.0.1:8080")?
    .run()
    .await
}

Add this to your Cargo.toml:

[dependencies]
actix-governor = "0.3"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].