2017 © Pedro Peláez
 

yii2-module yii2-ip-ratelimiter

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

image

uz/yii2-ip-ratelimiter

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

  • Friday, November 25, 2016
  • by uz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % 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 uz/yii2-ip-ratelimiter "^1.0"

or add, (*5)

"uz/yii2-ip-ratelimiter": "^1.0"

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' => \Mronx\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;
}

Forked from ethercreative/yii2-ip-ratelimiter, (*8)

The Versions

25/11 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

yii2 ratelimiter

25/11 2016

1.0.2

1.0.2.0

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

  Sources   Download

MIT

yii2 ratelimiter

25/11 2016

v1.0.1

1.0.1.0

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

  Sources   Download

MIT

yii2 ratelimiter

25/11 2016

1.0.0

1.0.0.0

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

  Sources   Download

MIT

yii2 ratelimiter