melikceran/laravel-ratelimit-advanced
Composer 安装命令:
composer require melikceran/laravel-ratelimit-advanced
包简介
Extends Laravel Rate Limiting class and gives unlimited access to search engines.
README 文档
README
It is the extended version of the Laravel Rate Limiting class. Removes limitations on search engine bots.
100% Detects fake bots. Detects real bots with IP and Reverse DNS queries. It supports IPv4 and IPv6.
Default supported Search Engine Bots;
Google, Bing, Msn, Yandex, Yahoo, Baidu, Petalbot
How does it work?
- Checks whether the User-Agent information belongs to the search engine.
- Performs DNS Lookup check from IP address.
- It confirms that it is a real search engine bot by doing a reverse DNS query.
- If it is a allowed bot, it will whitelist the IPv4/Ipv6 address.
- It also limits the last block of the requesting visitor's IP address (1.1.1.x). It blocks requests and attacks from the same block.
- Other visitors can enter the site within the limits you specify.
Available for API or Web. In API usage, it returns over-limit information in json format.
{'status':429, 'message':'Too Many Requests!'}
Requirements;
It is an extended version of the Laravel Rate Limiter class. There is no extra requirement.
Caching: Laravel Cache
Rate Limit: Laravel RateLimiter
Ip Lookup: gethostbyaddr()
Reverse DNS Lookup: dns_get_record()
Install
composer require melikceran/laravel-ratelimit-advanced
Configuration
To publish the configuration file; (config/ratelimit.php)
php artisan vendor:publish --tag=ratelimit
Use of;
Specify how many requests per minute visitors can make.
Route::get('/', function () {
return view('welcome');
})->middleware('ratelimit:30');
For real-time querying without using cache;
Route::get('/', function () {
return view('welcome');
})->middleware('ratelimit:30,false');
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-02