承接 profburial/tordetect 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

profburial/tordetect

最新稳定版本:v1.1

Composer 安装命令:

composer require profburial/tordetect

包简介

Easily detect tor users.

关键字:

README 文档

README

I love Tor and most everything it represents. However, in certain use cases, people can use Tor to be jerks.

*** Disclaimer ***

You probably shouldn't use this lib as is if you are wanting to do anything serious. It maintains a json file with a list of Tor exit nodes that should be stored elsewhere for more serious applications.

Support

If you use this library or it's components in a commercial project please consider a moral license

Installation

composer require profburial/tordetect 1.1

Usage

Create a writable json file to store your ip data.

// Get a list of Tor exit nodes
$ips = (new ProfBurial\TorDetect\Client(
    __DIR__."/_data/torexitnodes.json", // File for storing ips
    24 // Update every 24 hours
))->get();

// array(1067) {
//   [0]=>
//   string(13) "1.169.207.157"
//   [1]=>
//   string(12) "2.107.22.186"
//   [2]=>
//   string(11) "2.111.64.26"
//   [3]=>
//   string(11) "2.221.39.34"
//   ...
// }

// Check an ip address against your list of exit nodes
$check = (new ProfBurial\TorDetect\Client(
    __DIR__."/_data/torexitnodes.json", // File for storing ips
    24 // Update every 24 hours
))->check('127.0.0.1');

// bool(false) if not found
// '127.0.0.1' if found

Tests

Unit:

phpunit tests/ClientUnitTest.php

Integration:

phpunit tests/ClientIntegrationTest.php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-19