An open API service indexing awesome lists of open source software.

https://github.com/a3r0id/php-rate-limiting

A simple system to rate-limit site visitors by time interval/request amount.
https://github.com/a3r0id/php-rate-limiting

include measures php rate-limiting security simple turnkey turnkey-script

Last synced: 9 months ago
JSON representation

A simple system to rate-limit site visitors by time interval/request amount.

Awesome Lists containing this project

README

          

# php-rate-limiting
A simple system to rate-limit site visitors by time interval/request amount.

## This is NOT a good solution for production use! For a more secure and scalable solution, refer to something like [nikolaposa/rate-limit](https://github.com/nikolaposa/rate-limit).

Adjust specifications via config.json (aka rate-limiting.conf).

-------

## Usage:

[1] Edit your configuration:

Notes:


If "die_on_rate_limit" is false then visitor will be redirected to the "redirect_location" when limited.


"request_allowance" should always be (amount to allow + 1) as in regards to the example config, it will limit the visitor on their 25th request, NOT THE 26th!

```json
[
{
"database_file_name": "/usr/share/requests.json",
"interval_time_seconds": 300,
"request_allowance": 25,
"redirect_location": "https://google.com",
"die_on_rate_limit": false
}
]
```
[2] - Include in your project
```php

```