limych / foxy-tools
“我庄严地宣誓,我正在计划一个恶作剧,而且只是恶作剧……”
v0.3
2018-10-06 08:39 UTC
Requires
- php: >=5.5
Requires (Dev)
- doctrine/cache: ~1.6
- friendsofphp/php-cs-fixer: ^2.13
Suggests
- doctrine/cache: Allow cache http-requests by Fetcher.
This package is auto-updated.
Last update: 2024-09-18 18:08:22 UTC
README
“我庄严地宣誓,我正在计划一个恶作剧,而且只是恶作剧……”
Foxy-Tools — 是一套用于网络中不太合法情况的PHP工具。
安装
使用Composer
Composer 是安装Foxy-Tools的推荐方式。如果您不想使用Composer,但仍想安装Foxy-Tools,您可以直接下载。
目前,Foxy-Tools可在 packagist.org 获取。要在项目中使用它,您需要在项目的composer.json文件中将它作为依赖项包含。
说明
-
如果尚未安装,请下载 Composer
-
转到您的项目目录。如果没有,请创建一个目录并使用
cd进入。$ mkdir project $ cd project -
在命令行中执行
composer require "paypal/rest-api-sdk-php:*"。如果需要,请将composer替换为composer.phar。它应该显示类似以下内容$ composer require limych/foxy-tools # output: ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev) - Installing limych/foxy-tools (v1.0) Loading from cache Writing lock file Generating autoload files
使用直接下载
如果您不想使用composer,可以下载包含Foxy-Tools及其所有依赖项的zip文件。
说明
- 从 发行版部分 下载最新/所需版本的zip文件。
- 转到您的项目目录。如果没有,请创建一个目录并使用
cd进入。
mkdir project
cd project
- 解压,并将目录复制到您的项目位置
使用
代理格式
{type}://{user}:{password}@{host}:{port}
一些示例
183.95.132.76
195.5.18.41:8118
socks5://195.5.18.41:8118
socks5://user:password@195.5.18.41:8118
检查一个代理
$pingUrl = 'http://yourdomain.com/ping.php';
$proxy = 'xxx.xxx.xxx.xxx:xx';
$proxyChecker = new ProxyChecker($pingUrl);
$results = $proxyChecker->checkProxy($proxy);
检查多个代理
$pingUrl = 'http://yourdomain.com/ping.php';
$proxies = array('xxx.xxx.xxx.xxx:xx', 'xxx.xxx.xxx.xxx:xx');
$proxyChecker = new ProxyChecker($pingUrl);
$results = $proxyChecker->checkProxies($proxies);
结果
允许/不允许
允许/不允许操作的代理数组(get、post、referer、cookie、user_agent),例如
'allowed' => array (
0 => 'get',
1 => 'post',
2 => 'referer',
3 => 'user_agent'
)
'disallowed' => array (
0 => 'cookie'
)
代理级别
-
精英 — 连接看起来像常规客户端;
-
匿名 — 不转发ip,但目标网站仍能知道它是一个代理;
-
透明 — 转发ip,目标网站能够知道它是一个代理。
'proxy_level' => 'elite'
其他信息
其他代理信息 - 时间、http代码、重定向次数、速度等
'info' => array (
'content_type' => 'text/html',
'http_code' => 200,
'header_size' => 237,
'request_size' => 351,
'ssl_verify_result' => 0,
'redirect_count' => 0,
'total_time' => 1.212548,
'connect_time' => 0.058647,
'size_upload' => 143,
'size_download' => 485,
'speed_download' => 399,
'speed_upload' => 117,
'download_content_length' => 485,
'upload_content_length' => 143,
'starttransfer_time' => 1.059746,
'redirect_time' => 0,
'certinfo' => array (),
)