0.0
No release in over a year
Redis backed token bucket rate limting implementation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 2.0, < 3.0
>= 4.0, < 5.0
 Project Readme

ActionLimiter

Ruby Gem

Provides Redis backed rate limiting for Rails applications.

Installing

gem install actionlimiter
bundle add actionlimiter

Usage

Set Redis URL

Rails.application.configure do |config|
  config.redis = { url: 'redis://localhost:6379/0' }
end

Rails IP Middleware

Rails.application.configure do |config|
  # Limit a single IP to 20 requests in a 5 second period.
  config.middleware.use(ActionLimiter::Middleware::IP, period: 5, size: 20)
end