aalfiann/pubproxy-class-php
Composer 安装命令:
composer require aalfiann/pubproxy-class-php
包简介
Get working public proxy list for free by PubProxy (No API key required).
关键字:
README 文档
README
Get working public proxy list for free by PubProxy (No API key required).
Known Limitations
As free user, there is only 50 request a day. So we cached the request per 30minutes to save your quota.
We recommend you to buy the premium proxy to get the best experience, realtime and unlimited.
Installation
Install this package via Composer.
composer require "aalfiann/pubproxy-class-php:^1.0"
Usage
Get Proxy (Rotate Automatically)
require_once ('vendor/autoload.php'); use \aalfiann\PubProxy; $proxy = new PubProxy; echo $proxy->make()->getProxy();
Get Proxy List
require_once ('vendor/autoload.php'); use \aalfiann\PubProxy; $proxy = new PubProxy; // with Json format echo $proxy->make()->getJson(); // with Text format echo $proxy->make()->getText();
Get Proxy List with Custom Options
require_once ('vendor/autoload.php'); use \aalfiann\PubProxy; $proxy = new PubProxy; $proxy->level = 'elite'; $proxy->type = 'http'; $proxy->country = 'us'; $proxy->make()->getJson();
Chain Usage Example
require_once ('vendor/autoload.php'); use \aalfiann\PubProxy; $proxy = new PubProxy; echo $proxy->setLevel('elite')->setType('http')->setCountry('us')->make()->getJson();
Properties PubProxy
$api='',$level='',$type='',$country='',$not_country='',$port='',$google='',$https='',$post='',$user_agent='',$cookies='',$referer='',$limit=5,$last_check=0,$speed=0;
Properties Feature
$refresh=1800,$dircache='',$filepath='',$proxy='',$proxyauth='',$response,$resultArray=null;
Chain Function
- setApi($api='') this will make your request realtime and unlimited by buying PubProxy Premium.
- setLimit($limit=5) this will display proxies by limit number. Default is 5.
- setType($type='') this will display proxies by proxy protocol (socks4, socks5 and http).
- setLevel($level='') this will display proxies by anonymity level (anonymous and elite).
- setLastCheck($last_check=0) this will display proxies which is how long minutes the proxy was last checked?
- setSpeed($speed=0) this will display proxy which is how many seconds it takes for the proxy to connect?
- setCountry($country='') this will display proxy from country that we wanted (input multiple with separated commas).
- setNotCountry($not_country='') this will display avoided proxy countries (input multiple with separated commas).
- setPort($port='') this will display proxies with a specific port (input multiple with separated commas).
- setGoogle($google='') this will display proxies which is Google passed proxies.
- setHttps($https='') this will display proxies which is supports HTTPS request.
- setPost($post='') this will display proxies which is supports POST request.
- setUserAgent($user_agent='') this will display proxies which is supports USER_AGENT request.
- setCookies($cookies='') this will display proxies which is supports COOKIES request.
- setReferer($referer='') this will display proxies which is supports REFERER request.
- setRefresh($refresh=1800) this will cache the proxy. Default is 1800 seconds (every 30minutes proxy will refresh automatically).
- setDirCache($dircache='') this will set directory location without change the default filename cache. Default is "cache-proxy".
- setFilepath($filepath='') this will create custom file cache. Default is "cache-proxy/{{md5}}.cache".
Main Function
- make() Make process to get proxy list response.
- getJson() Get response as json format.
- getText() Get response as text/plain format
- getProxy() Get single proxy (ip:port and rotate automatically if the proxy limit is more than 1)
Cache Function
- isHit() to check the cached proxy list is still valid or not
- fetch() to fetch the cached proxy list
- write($content) to write proxy list data to file cache.
- clear() to clear the file cache
aalfiann/pubproxy-class-php 适用场景与选型建议
aalfiann/pubproxy-class-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 198 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「proxy」 「anonymous」 「elite」 「proxy-list」 「http-proxy」 「free-proxy」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aalfiann/pubproxy-class-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aalfiann/pubproxy-class-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aalfiann/pubproxy-class-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lazy loading for middleware and request handlers
Laravel Facade Docblock Generator
Provides anonymous voting for any models
Anonymous discussions and replies for logged in users
Anonymous post support
PHP Script to perform Reverse Proxy Functionality
统计信息
- 总下载量: 198
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-05