定制 inis/antibot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inis/antibot

最新稳定版本:8.1.1

Composer 安装命令:

composer require inis/antibot

包简介

Simple IP AntiBot class using Redis

README 文档

README

Install php5:

composer require inis/antibot:dev-release/php5

Install php7:

composer require inis/antibot:dev-release/php7

Check test/atibots_tests.php for some examples.

Configuration:

More than 5 calls within 20 seconds is a bot traffic

$CONF['ip_blocker']['ip_limit'] = 5;
$CONF['ip_blocker']['ip_ttl'] = 20;

More than 10 calls within 40 seconds from a subnet is a bot traffic

$CONF['ip_blocker']['subnet_limit'] = 10;
$CONF['ip_blocker']['subnet_ttl'] = 40;
$CONF['ip_blocker']['octets_per_subnet'] = 3;

Array of blacklisted IPs/subnets - always allow traffic

$CONF['ip_blocker']['whitelist'] = [];

Array of whitelisted IPs/subnets - always block traffic

$CONF['ip_blocker']['blacklist'] = [];

Some more criteria to pass traffic (language, country)

$CONF['ip_blocker']['accept_language_preg'] = '/pl/i';
$CONF['ip_blocker']['accept_country_preg'] = '/pl/i';
$CONF['ip_blocker']['reject_language_preg'] = '/en/i';
$CONF['ip_blocker']['reject_country_preg'] = '/us/i';
$CONF['ip_blocker']['reject_user_agent_preg'] = '/GoogleImageProxy/i';

Redis prefixes for your environment, keep it different

$CONF['ip_blocker']['check_redis_prefix'] = 'cl_';
$CONF['ip_blocker']['block_redis_prefix'] = '';

Run tests with:

./vendor/bin/phpunit --bootstrap vendor/autoload.php tests

Run code covarage (with xdebug installed) with:

./vendor/bin/phpunit --bootstrap vendor/autoload.php --coverage-html cc-report/ --whitelist src/ tests

统计信息

  • 总下载量: 2.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固