ip2location/codeigniter-ip2proxy
Composer 安装命令:
composer require ip2location/codeigniter-ip2proxy
包简介
IP2Proxy library for CodeIgniter. This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database. Other information available includes proxy type, c
关键字:
README 文档
README
This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks, and enterprise private networks. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats, last seen date and provider names.
Installation
Upload controllers and libraries to CodeIgniter application folder.
Usage
This module is able to query the IP address information from either BIN database or web service. This section will explain how to use this extension to query from BIN database and web service.
Sample codes are given in this project, under controllers folder. You may run the sample code by using <your_domain>/index.php/ip2proxy_test.
BIN Database
Use following codes in your application for get geolocation information.
// (optional) Define IP2Proxy database path.
define('IP2PROXY_DATABASE', '/path/to/ip2proxy/database');
$ipx = new IP2Proxy_lib();
$countryCode = $ipx->getCountryShort('1.0.241.135');
Below are the methods supported for BIN data file lookup.
$countryShort = $ipx->getCountryShort($ip);
$countryLong = $ipx->getCountryLong($ip);
$region = $ipx->getRegion($ip);
$city = $ipx->getCity($ip);
$isp = $ipx->getISP($ip);
$doamin = $ipx->getDomain($ip);
$usageType = $ipx->getUsageType($ip);
$proxyType = $ipx->getProxyType($ip);
$asn = $ipx->getASN($ip);
$as = $ipx->getAS($ip);
$lastSeen = $ipx->getLastSeen($ip);
$threat = $ipx->getThreat($ip);
$provider = $ipx->getProvider($ip);
$isProxy = $ipx->isProxy($ip);
Web Service
Use following codes in your application for get geolocation information.
// (required) Define IP2Proxy API key.
define('IP2PROXY_API_KEY', 'your_api_key');
// (required) Define IP2Proxy Web service package of different granularity of return information.
define('IP2PROXY_PACKAGE', 'PX1');
// (optional) Define to use https or http.
define('IP2PROXY_USESSL', false);
$ipx = new IP2Proxy_lib();
print_r ($ipx->getWebService('1.0.241.135'));
Dependencies
This module requires IP2Proxy BIN data file or IP2Proxy API key to function. You may download the BIN data file at
- IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com
- IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database
You can also sign up for IP2Proxy Web Service to get one free API key.
IPv4 BIN vs IPv6 BIN
- Use the IPv4 BIN file if you just need to query IPv4 addresses.
- Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
SUPPORT
Email: support@ip2location.com
Website: https://www.ip2location.com
ip2location/codeigniter-ip2proxy 适用场景与选型建议
ip2location/codeigniter-ip2proxy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 09 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「web service」 「geolocation」 「proxy」 「ip-database」 「geolocation-information」 「ip-geolocation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ip2location/codeigniter-ip2proxy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ip2location/codeigniter-ip2proxy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ip2location/codeigniter-ip2proxy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Maps in minutes. Powered by the Google Maps API.
Model of a web-based resource
The official PHP library for apiip.net that allowing customers to automate IP address validation and geolocation lookup in websites, applications and back-office system. Visit our API docs at https://apiip.net/documentation
A fast and intuitive dependency injection container.
Registry service.
Retrieve a WebResourceInterface instance over HTTP
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-14