Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ip2location/ip2proxy-cakephp

IP2Proxy CakePHP plugin enables the user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.
https://github.com/ip2location/ip2proxy-cakephp

cakephp cakephp-plugin ip2proxy ip2proxy-bin-databases ip2proxy-cakephp proxy-checker proxy-database tor-exits vpn-anonymizer web-proxy

Last synced: about 1 month ago
JSON representation

IP2Proxy CakePHP plugin enables the user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

Awesome Lists containing this project

README

        

# IP2Proxy CakePHP Plugin
[![Latest Stable Version](https://img.shields.io/packagist/v/ip2location/ip2proxy-cakephp.svg)](https://packagist.org/packages/ip2location/ip2proxy-cakephp)
[![Total Downloads](https://img.shields.io/packagist/dt/ip2location/ip2proxy-cakephp.svg?style=flat-square)](https://packagist.org/packages/ip2location/ip2proxy-cakephp)

IP2Proxy CakePHP plugin enables the user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks and enterprise private networks. It lookup the proxy IP address from IP2Proxy BIN Data file or web service. Developers can use the API to query all IP2Proxy BIN databases or web service for applications written using CakePHP.

Note: This plugin works in CakePHP 4 and CakePHP 5.

## INSTALLATION
1. Run the command: `composer require ip2location/ip2proxy-cakephp` to download the plugin into the CakePHP platform.
2. Download latest IP2Proxy BIN database
- IP2Proxy free LITE database at https://lite.ip2location.com
- IP2Proxy commercial database at https://www.ip2location.com/proxy-database
3. Unzip and copy the BIN file into *cakephp/vendor/ip2location/ip2proxy-cakephp/src/Data* folder.
4. Rename the BIN file to IP2PROXY.BIN.

**Note:** The plugin has included an old BIN database for your testing and development purpose.
You may want to download a latest copy of BIN database as the URL stated above.
The BIN database refers to the binary file ended with .BIN extension, but not the CSV format.
Please select the right package for download.

## USAGE
In this tutorial, we will show you on how to create a **TestsController** to display the IP information.

1. Create a **TestsController** in CakePHP using the below command line
```
php bin/cake bake controller Tests
```
2. Create an empty **index.php** file in *cakephp/templates/Tests* folder.
3. Open the **cakephp/src/Controller/TestsController.php** in any text editor.
4. Remove the contents in TestsController.php and add the below lines into the controller file.
```
get('1.0.241.135');
echo 'Result from BIN Database:
';
echo '

IP Address: ' . $record['ipAddress'] . '

';
echo '

IP Number: ' . $record['ipNumber'] . '

';
echo '

IP Version: ' . $record['ipVersion'] . '

';
echo '

Country Code: ' . $record['countryCode'] . '

';
echo '

Country: ' . $record['countryName'] . '

';
echo '

State: ' . $record['regionName'] . '

';
echo '

City: ' . $record['cityName'] . '

';
echo '

Proxy Type: ' . $record['proxyType'] . '

';
echo '

Is Proxy: ' . $record['isProxy'] . '

';
echo '

ISP: ' . $record['isp'] . '

';
echo '

Domain: ' . $record['domain'] . '

';
echo '

Usage Type: ' . $record['usageType'] . '

';
echo '

ASN: ' . $record['asn'] . '

';
echo '

AS: ' . $record['as'] . '

';
echo '

Last Seen: ' . $record['lastSeen'] . '

';
echo '

Threat: ' . $record['threat'] . '

';
echo '

Provider: ' . $record['provider'] . '

';

$record = $IP2Proxy->getWebService('1.0.241.135');
echo 'Result from Web service:
';
echo '

';

print_r ($record);
echo '
';
}

}
```
5. Enter the URL /Tests and run. You should see the information of **1.0.241.135** IP address.

## DEPENDENCIES
This library requires IP2Proxy BIN or IP2Proxy API key data file 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 [IP2Location.io IP Geolocation API](https://www.ip2location.io/sign-up) to get one free API key.

## SUPPORT
Email: [email protected]

Website: https://www.ip2location.com