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.
- Host: GitHub
- URL: https://github.com/a3r0id/php-rate-limiting
- Owner: a3r0id
- Created: 2020-09-05T19:42:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T06:07:12.000Z (over 1 year ago)
- Last Synced: 2025-03-22T06:12:35.396Z (9 months ago)
- Topics: include, measures, php, rate-limiting, security, simple, turnkey, turnkey-script
- Language: PHP
- Homepage:
- Size: 52.7 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```