Project

notsofast

0.0
No commit activity in last 3 years
No release in over 3 years
Rate limiting gem based on IP address
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Notsofast

Rate limiting rails rack gem. Add to gem file to start limiting based on IP

Installation

Add this line to your application's Gemfile:

gem 'notsofast'

And then execute:

$ bundle

Or install it yourself as:

$ gem install notsofast

Usage

By default starts limiting on 100 requests per minute. This is on an IP address basis.

Configuration

Create a rails initializer (config/initializers/notsofast.rb) with the following as required

### whitelist Set an array of string values containing whitelisted ip addresses eg ["127.0.0.1"]

Notsofast::Config.whitelist=[]

### blacklist Set an array of string values containing blacklisted ip addresses eg ["127.0.0.1"]

Notsofast::Config.blacklist=[]

request_limit

Specifies the number of permitted request per limit_exipry period

Notsofast::Config.request_limit=100

response_types

Specifies the response types that the limit applies to (eg ignore images and other assets)

Notsofast::Config.response_types=["text/html"]

### limit_expiry Sets the time before limits are reset and within which the limit is reached

Notsofast::Config.limit_expiry=60

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request