All Projects → ip2location → ip2proxy-php

ip2location / ip2proxy-php

Licence: MIT license
PHP module for IP2Proxy database lookup. It allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ip2proxy-php

ip2proxy-java
IP2Proxy Java Component.It can be used to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.
Stars: ✭ 16 (-67.35%)
Mutual labels:  ip2proxy, anonymous-proxy, ip2proxy-database, proxy-database
ip2proxy-go
IP2Proxy Go package allows users to query an IP address to determine if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.
Stars: ✭ 12 (-75.51%)
Mutual labels:  proxy-checker, ip2proxy, ip2proxy-database
ip2proxy-nodejs
IP2Proxy Node.js module allows users to query an IP address to determine if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.
Stars: ✭ 35 (-28.57%)
Mutual labels:  ip2proxy, anonymous-proxy, proxy-database
ip2proxy-python
Python library for IP2Proxy database lookup. It can be used to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.
Stars: ✭ 19 (-61.22%)
Mutual labels:  anonymous-proxy, ip2proxy-database, proxy-database
Proxybroker
Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS 🎭
Stars: ✭ 2,767 (+5546.94%)
Mutual labels:  proxy-checker
proxy-checker
The simple script, which checks good and bad proxies
Stars: ✭ 42 (-14.29%)
Mutual labels:  proxy-checker
proxy checker
A checker designed in Python 3 for checking proxy.
Stars: ✭ 37 (-24.49%)
Mutual labels:  proxy-checker
Hacking-tools
INSTAGRAM DM BOT | MULTI-THREADING REQUESTS BASED | PROXY SUPPORT
Stars: ✭ 35 (-28.57%)
Mutual labels:  proxy-checker
Live-cc-checker
This script will check live cc and Grab proxy and check proxy if its working or not
Stars: ✭ 37 (-24.49%)
Mutual labels:  proxy-checker
proxyhunter
ProxyHunter v1 - Searches IP ranges for SOCKS and SQUID proxy servers
Stars: ✭ 27 (-44.9%)
Mutual labels:  proxy-checker
torchestrator
Spin up Tor containers and then proxy HTTP requests via these Tor instances
Stars: ✭ 32 (-34.69%)
Mutual labels:  proxy-checker
proxy fetcher
💪 Ruby / JRuby / TrufflleRuby gem & CLI for dealing with proxy lists from various sources
Stars: ✭ 119 (+142.86%)
Mutual labels:  proxy-checker
ProxyChecker
proxy checker to check the status of the ip-port proxy list
Stars: ✭ 24 (-51.02%)
Mutual labels:  proxy-checker
Free-Proxy
Hi there will be a lot of proxies here.
Stars: ✭ 135 (+175.51%)
Mutual labels:  proxy-checker
ProxyChecker
An easy to use open-source, multithreaded Proxy Checker. Allows you to quickly check HTTP and SOCKS proxies in a user friendly GUI, for Windows, Mac OS, Linux.
Stars: ✭ 113 (+130.61%)
Mutual labels:  proxy-checker
darknet.py
darknet.py is a network application with no dependencies other than Python and Tor, useful to anonymize the traffic of linux servers and workstations.
Stars: ✭ 71 (+44.9%)
Mutual labels:  anonymous-proxy
autovpn2
OpenVPN VPN Gate Client for Linux, connects you to a random Free VPN in a country of your choice by country code.
Stars: ✭ 30 (-38.78%)
Mutual labels:  anonymous-proxy

IP2Proxy PHP Module

Latest Stable Version Total Downloads

This module allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits. It lookup the proxy IP address from IP2Proxy BIN Data file. This data file can be downloaded at

Methods

Below are the methods supported in this class.

BIN Database Class

Function Name Description
Constructor Expect 2 input parameters:
  1. Full path of IP2Proxy BIN data file.
  2. File Open Mode
    • SHARED_MEMORY
    • MEMORY_CACHE
    • FILE_IO
For SHARED_MEMORY and MEMORY_CACHE, it will require your server to have sufficient memory to hold the BIN data, otherwise it will raise the errors during the object initialization.
string getDatabaseVersion() Return the database's compilation date as a string of the form 'YYYY-MM-DD',
string getPackageVersion() Return the database's type, 1 to 10 respectively for PX1 to PX11. Please visit https://www.ip2location.com/databases/ip2proxy for details.
string getModuleVersion() Return the version of module.
array lookup($ip) Return the IP information in array. Below is the information returned:
  • ipNumber
  • ipVersion
  • ipAddress
  • countryCode
  • countryName
  • regionName
  • cityName
  • isp
  • domain
  • usageType
  • asn
  • as
  • lastSeen
  • threat
  • proxyType
  • isProxy
  • provider
You can visit IP2Location website for the description of each field. Note: although the above names are not exactly matched with the names given in this link, but they are self-described.

Web Service Class

Method Name Description
Constructor Expect 3 input parameters:
  1. IP2Proxy API Key.
  2. Package (PX1 - PX11)
  3. Use HTTPS or HTTP
lookup Return the proxy information in array.
  • countryCode
  • countryName
  • regionName
  • cityName
  • isp
  • domain
  • usageType
  • asn
  • as
  • lastSeen
  • threat
  • proxyType
  • isProxy
  • provider
getCredit Return remaining credit of the web service account.

Usage

BIN Database

Open and read IP2Proxy binary database. There are 3 modes:

  1. \IP2Proxy\Database::FILE_IO - File I/O reading. Slower look, but low resource consuming.
  2. \IP2Proxy\Database::MEMORY_CACHE - Caches database into memory for faster lookup. Required high memory.
  3. \IP2Proxy\Database::SHARED_MEMORY - Stores whole IP2Proxy database into system memory. Lookup is possible across all applications within the system. Extremely resources consuming. Do not use this mode if your system do not have enough memory.
require 'vendor/autoload.php';

$db = new \IP2Proxy\Database('vendor/ip2location/ip2proxy-php/data/PX11.SAMPLE.BIN', \IP2PROXY\Database::FILE_IO);

To start lookup result from database, use the following codes:

$records = $db->lookup('1.0.0.8', \IP2PROXY\Database::ALL);

Results are returned in array.

echo '<p><strong>IP Address: </strong>' . $records['ipAddress'] . '</p>';
echo '<p><strong>IP Number: </strong>' . $records['ipNumber'] . '</p>';
echo '<p><strong>IP Version: </strong>' . $records['ipVersion'] . '</p>';
echo '<p><strong>Country Code: </strong>' . $records['countryCode'] . '</p>';
echo '<p><strong>Country: </strong>' . $records['countryName'] . '</p>';
echo '<p><strong>State: </strong>' . $records['regionName'] . '</p>';
echo '<p><strong>City: </strong>' . $records['cityName'] . '</p>';

/*
  Type of proxy: VPN, TOR, DCH, PUB, WEB, RES (RES available in PX11 only)
*/
echo '<p><strong>Proxy Type: </strong>' . $records['proxyType'] . '</p>';

/*
  Returns -1 on errors
  Returns 0 is not proxy
  Return 1 if proxy
  Return 2 if it's data center IP
*/
echo '<p><strong>Is Proxy: </strong>' . $records['isProxy'] . '</p>';
echo '<p><strong>ISP: </strong>' . $records['isp'] . '</p>';
echo '<p><strong>Domain: </strong>' . $records['domain'] . '</p>';
echo '<p><strong>Usage Type: </strong>' . $records['usageType'] . '</p>';
echo '<p><strong>ASN: </strong>' . $records['asn'] . '</p>';
echo '<p><strong>AS: </strong>' . $records['as'] . '</p>';
echo '<p><strong>Last Seen: </strong>' . $records['lastSeen'] . '</p>';
echo '<p><strong>Threat: </strong>' . $records['threat'] . '</p>';
echo '<p><strong>Provider: </strong>' . $records['provider'] . '</p>';

Web Service API

To lookup by Web service, you will need to sign up for IP2Proxy Web Service to get a API key.

Start your lookup by following codes:

require 'vendor/autoload.php';

// Lookup by Web API
$ws = new \IP2Proxy\WebService('YOUR_API_KEY',  'PX11', false);

$results = $ws->lookup('1.0.241.135');

if ($results !== false) {
    echo '<p><strong>Country Code: </strong>' . $results['countryCode'] . '</p>';
    echo '<p><strong>Country Name: </strong>' . $results['countryName'] . '</p>';
    echo '<p><strong>Region: </strong>' . $results['regionName'] . '</p>';
    echo '<p><strong>City: </strong>' . $results['cityName'] . '</p>';
    echo '<p><strong>ISP: </strong>' . $results['isp'] . '</p>';
    echo '<p><strong>Domain: </strong>' . $results['domain'] . '</p>';
    echo '<p><strong>Usage Type: </strong>' . $results['usageType'] . '</p>';
    echo '<p><strong>ASN: </strong>' . $results['asn'] . '</p>';
    echo '<p><strong>AS: </strong>' . $results['as'] . '</p>';
    echo '<p><strong>Last Seen: </strong>' . $results['lastSeen'] . ' Day(s)</p>';
    echo '<p><strong>Proxy Type: </strong>' . $results['proxyType'] . '</p>';
    echo '<p><strong>Threat: </strong>' . $results['threat'] . '</p>';
    echo '<p><strong>Provider: </strong>' . $results['provider'] . '</p>';
    echo '<p><strong>Is Proxy: </strong>' . $results['isProxy'] . '</p>';
}

Reference

Proxy Type

Type Description Anonymity
VPN Anonymizing VPN services. These services offer users a publicly accessible VPN for the purpose of hiding their IP address. High
TOR Tor Exit Nodes. The Tor Project is an open network used by those who wish to maintain anonymity. High
DCH Hosting Provider, Data Center or Content Delivery Network. Since hosting providers and data centers can serve to provide anonymity, the Anonymous IP database flags IP addresses associated with them. Low
PUB Public Proxies. These are services which make connection requests on a user's behalf. Proxy server software can be configured by the administrator to listen on some specified port. These differ from VPNs in that the proxies usually have limited functions compare to VPNs. High
WEB Web Proxies. These are web services which make web requests on a user's behalf. These differ from VPNs or Public Proxies in that they are simple web-based proxies rather than operating at the IP address and other ports level. High
SES Search Engine Robots. These are services which perform crawling or scraping to a website, such as, the search engine spider or bots engine. Low
RES Residential proxies. These services offer users proxy connections through residential ISP with or without consents of peers to share their idle resources. Only available with PX11 Medium

Usage Type

  • (COM) Commercial
  • (ORG) Organization
  • (GOV) Government
  • (MIL) Military
  • (EDU) University/College/School
  • (LIB) Library
  • (CDN) Content Delivery Network
  • (ISP) Fixed Line ISP
  • (MOB) Mobile ISP
  • (DCH) Data Center/Web Hosting/Transit
  • (SES) Search Engine Spider
  • (RSV) Reserved
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].