17/08
2016
dev-master
9999999-devSlim Middleware for having Rate Limits with Redis
MIT
The Requires
by Nils Hulsch
Wallogit.com
2017 © Pedro Peláez
Slim Middleware for having Rate Limits with Redis
PSR-7 Ratelimiter, (*1)
$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., (*2)
Class will also check if the Cloudflare UserIP header is set and will use that for tracking., (*3)
Slim Middleware for having Rate Limits with Redis
MIT