nhulsch / slim-redis-rlimit
Slim Middleware for having Rate Limits with Redis
Installs: 24
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nhulsch/slim-redis-rlimit
Requires
- php: >=5.5
- cheprasov/php-redis-client: ^1.3
- psr/http-message: >=1.0
This package is not auto-updated.
Last update: 2021-06-26 01:32:25 UTC
README
PSR-7 Ratelimiter
Usage
$app = new Slim\App(); $app->add(new \Slim\Middleware\RedisRatelimit('tcp://127.0.0.1:6379', 500, 300));
This will be called on every requests and checks if the number of requests (in this case 500) exceeds within 300 seconds.
Class will also check if the Cloudflare UserIP header is set and will use that for tracking.