luisinder/ip-control-middleware

通过IP控制访问的中间件

1.2 2016-10-26 14:44 UTC

This package is auto-updated.

Last update: 2024-09-20 04:02:54 UTC


README

Latest Stable Version Total Downloads

控制能够访问应用的IP地址的中间件。

  • 允许添加多个IP地址。
  • 定义IP不允许时的返回URL。

安装

使用Composer

$ composer require luisinder/ip-control-middleware

使用

允许的IP必须在一个数组中。第二个参数是失败时的返回URL。

$app->add(new Luisinder\Middleware\IpControl(['::1','192.168.1.0','127.0.0.1'],"https://github.com"));