You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# IP2Proxy Java Component
2
2
3
-
This component allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range and search engine robots (SES). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
3
+
This component allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES) and residential (RES). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
4
4
5
5
* Free IP2Proxy BIN Data: https://lite.ip2location.com
6
6
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/database/ip2proxy
@@ -19,28 +19,29 @@ Below are the methods supported in this class.
19
19
|---|---|
20
20
|Open|Open the IP2Proxy BIN data for lookup. Please see the **Usage** section of the 2 modes supported to load the BIN data file.|
21
21
|Close|Close and clean up the file pointer.|
22
-
|GetPackageVersion|Get the package version (1 to 8 for PX1 to PX8 respectively).|
22
+
|GetPackageVersion|Get the package version (1 to 10 for PX1 to PX10 respectively).|
23
23
|GetModuleVersion|Get the module version.|
24
24
|GetDatabaseVersion|Get the database version.|
25
25
|IsProxy|Check whether if an IP address was a proxy. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address or search engine robot</li></ul>|
26
26
|GetAll|Return the proxy information in an object.|
27
-
|GetProxyType|Return the proxy type. Please visit <ahref="https://www.ip2location.com/database/px8-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen"target="_blank">IP2Location</a> for the list of proxy types supported|
27
+
|GetProxyType|Return the proxy type. Please visit <ahref="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential"target="_blank">IP2Location</a> for the list of proxy types supported|
28
28
|GetCountryShort|Return the ISO3166-1 country code (2-digits) of the proxy.|
29
29
|GetCountryLong|Return the ISO3166-1 country name of the proxy.|
30
30
|GetRegion|Return the ISO3166-2 region name of the proxy. Please visit <ahref="https://www.ip2location.com/free/iso3166-2"target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
31
31
|GetCity|Return the city name of the proxy.|
32
32
|GetISP|Return the ISP name of the proxy.|
33
33
|GetDomain|Return the domain name of the proxy.|
34
-
|GetUsageType|Return the usage type classification of the proxy. Please visit <ahref="https://www.ip2location.com/database/px8-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen"target="_blank">IP2Location</a> for the list of usage types supported.|
34
+
|GetUsageType|Return the usage type classification of the proxy. Please visit <ahref="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential"target="_blank">IP2Location</a> for the list of usage types supported.|
35
35
|GetASN|Return the autonomous system number of the proxy.|
36
36
|GetAS|Return the autonomous system name of the proxy.|
37
37
|GetLastSeen|Return the number of days that the proxy was last seen.|
38
+
|GetThreat|Return the threat type of the proxy.|
38
39
39
40
## Usage
40
41
41
42
Open and read IP2Proxy binary database. There are 2 modes:
42
43
43
-
1.**IOModes.IP2PROXY_FILE_IO** - File I/O reading. Slower look, but low resource consuming. This is the default.
44
+
1.**IOModes.IP2PROXY_FILE_IO** - File I/O reading. Slower lookup, but low resource consuming. This is the default.
44
45
2.**IOModes.IP2PROXY_MEMORY_MAPPED** - Stores whole IP2Proxy database into a memory-mapped file. Extremely resources consuming. Do not use this mode if your system do not have enough memory.
45
46
46
47
```java
@@ -67,10 +68,11 @@ public class Main {
67
68
StringASN;
68
69
StringAS;
69
70
StringLastSeen;
71
+
StringThreat;
70
72
71
73
StringIP="221.121.146.0";
72
74
73
-
if (Proxy.Open("/usr/data/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN.BIN", IP2Proxy.IOModes.IP2PROXY_MEMORY_MAPPED) ==0) {
75
+
if (Proxy.Open("/usr/data/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL.BIN", IP2Proxy.IOModes.IP2PROXY_MEMORY_MAPPED) ==0) {
0 commit comments