2017 © Pedro Peláez
 

yii2-module yii2-ip-ratelimiter

Allow guest clients to be rate limited, using their IP as the identifier.

image

ethercreative/yii2-ip-ratelimiter

Allow guest clients to be rate limited, using their IP as the identifier.

  • Tuesday, October 17, 2017
  • by mattether
  • Repository
  • 3 Watchers
  • 15 Stars
  • 6,060 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 2 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

Yii2 IP Rate Limiter, (*1)

yii2-ip-ratelimiter

Allow guest clients to be rate limited, using their IP as the identifier., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require ethercreative/yii2-ip-ratelimiter "1.*"

or add, (*5)

"ethercreative/yii2-ip-ratelimiter": "1.*"

to the require section of your composer.json file., (*6)

Usage

Modify the bahavior method of the controller you want to rate limit, (*7)

public function behaviors()
{
    $behaviors = parent::behaviors();
    $behaviors['rateLimiter'] = [
        // Use class
        'class' => \ethercreative\ratelimiter\RateLimiter::className(),

        // The maximum number of allowed requests
        'rateLimit' => 100,

        // The time period for the rates to apply to
        'timePeriod' => 600,

        // Separate rate limiting for guests and authenticated users
        // Defaults to true
        // - false: use one set of rates, whether you are authenticated or not
        // - true: use separate ratesfor guests and authenticated users
        'separateRates' => false,

        // Whether to return HTTP headers containing the current rate limiting information
        'enableRateLimitHeaders' => false,
    ];
    return $behaviors;
}

The Versions

17/10 2017

dev-master

9999999-dev

Allow guest clients to be rate limited, using their IP as the identifier.

  Sources   Download

MIT

by Yaroslav Lukyanov
by Matt Edmonston

yii2 ratelimiter

29/04 2016

1.0

1.0.0.0

Allow guest clients to be rate limited, using their IP as the identifier.

  Sources   Download

MIT

by Matt Edmonston

yii2 ratelimiter