quillphp/limiter
Composer 安装命令:
composer require quillphp/limiter
包简介
Quill PHP limiter middleware
README 文档
README
High-performance rate limiting middleware for the Quill PHP Framework. Protects your API from brute-force and DDoS attacks.
Installation
composer require quillphp/limiter
Usage
use Quill\Limiter\Limiter; use Quill\Storage\RedisStorage; $app->use(Limiter::new([ 'storage' => new RedisStorage(['host' => '127.0.0.1']), 'limit' => 100, // 100 requests 'window' => 60, // per 60 seconds ]));
Configuration
| Option | Default | Description |
|---|---|---|
| `limit` | `100` | Maximum number of requests allowed in the window. |
| `window` | `60` | Time window in seconds. |
| `key_generator` | `fn(Request $r) => $r->ip()` | Custom key generator for throttling. |
| `error_code` | `429` | HTTP status code for rate limit exceeded. |
| `error_message` | `'Too Many Requests'` | Error message for rate limit exceeded. |
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-06