2017 © Pedro Peláez
 

yii2-module yii2-ip-ratelimiter

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

image

andreyv/yii2-ip-ratelimiter

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

  • Wednesday, November 22, 2017
  • by andrey-tm
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1,649 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 5 Versions
  • 41 % 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 andreyv/yii2-ip-ratelimiter "2.*"

or add, (*5)

"andreyv/yii2-ip-ratelimiter": "2.*"

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' => \andreyv\ratelimiter\IpRateLimiter::class,

        // 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 false
        // - false: use one set of rates, whether you are authenticated or not
        // - true: use separate ratesfor guests and authenticated users
        'separateRates' => true,

        // Whether to return HTTP headers containing the current rate limiting information
        'enableRateLimitHeaders' => false,

        // Array of actions on which to apply ratelimiter, if empty - applies to all actions
        'actions' => ['index'],

        // Allows to skip rate limiting for test environment
        'testMode' => true,
        // Defines whether proxy enabled, list of headers getting from request ipHeaders. By default ['X-Forwarded-For']
        'proxyEnabled' => false
    ];
    return $behaviors;
}

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

The Versions

22/11 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Yaroslav Lukyanov
by Matt Edmonston
by Andreyv V

yii2 ratelimiter

22/11 2017

2.2.0

2.2.0.0

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

  Sources   Download

MIT

The Requires

 

by Yaroslav Lukyanov
by Matt Edmonston
by Andreyv V

yii2 ratelimiter

22/11 2017

2.1.0

2.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Yaroslav Lukyanov
by Matt Edmonston
by Andreyv V

yii2 ratelimiter

15/11 2017

2.0.0

2.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Yaroslav Lukyanov
by Matt Edmonston
by Andreyv V

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