Skip to content

Commit 2a88883

Browse files
Added example
1 parent 7a90eac commit 2a88883

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
IP2Proxy Node.js Module
22
=======================
3+
This is the Node.js module to detect proxy servers with country, region, city, ISP and proxy type information using IP2Proxy binary database.
34

4-
This is the Node.js module to lookup IP2Proxy databases from https://www.ip2location.com/proxy-database
5+
IP2Proxy database contains a list of daily-updated IP addresses which are being used as VPN anonymizer, open proxies, web proxies and Tor exits. The database includes records for IPv4 addresses.
56

6-
IP2Proxy Database contains IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits. The database includes records for all public IPv4 addresses.
7+
You can access to the commercial databases from https://www.ip2location.com/proxy-database or use the free IP2Proxy LITE database from http://lite.ip2location.com
78

89

910
Installation
@@ -14,6 +15,45 @@ To install this module type the following:
1415
npm install ip2proxy-nodejs
1516

1617

18+
Example
19+
=======
20+
21+
```javascript
22+
23+
var ip2proxy = require("ip2proxy-nodejs");
24+
25+
ip2proxy.Open("./IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.BIN");
26+
27+
ip = '199.83.103.79';
28+
29+
console.log("GetModuleVersion: " + ip2proxy.getModuleVersion());
30+
console.log("GetPackageVersion: " + ip2proxy.getPackageVersion());
31+
console.log("GetDatabaseVersion: " + ip2proxy.getDatabaseVersion());
32+
33+
// functions for individual fields
34+
console.log("isProxy: " + ip2proxy.isProxy(ip));
35+
console.log("ProxyType: " + ip2proxy.getProxyType(ip));
36+
console.log("CountryShort: " + ip2proxy.getCountryShort(ip));
37+
console.log("CountryLong: " + ip2proxy.getCountryLong(ip));
38+
console.log("Region: " + ip2proxy.getRegion(ip));
39+
console.log("City: " + ip2proxy.getCity(ip));
40+
console.log("ISP: " + ip2proxy.getISP(ip));
41+
42+
// function for all fields
43+
var all = ip2proxy.getAll(ip);
44+
console.log("isProxy: " + all.Is_Proxy);
45+
console.log("ProxyType: " + all.Proxy_Type);
46+
console.log("CountryShort: " + all.Country_Short);
47+
console.log("CountryLong: " + all.Country_Long);
48+
console.log("Region: " + all.Region);
49+
console.log("City: " + all.City);
50+
console.log("ISP: " + all.ISP);
51+
52+
ip2proxy.Close();
53+
54+
```
55+
56+
1757
Copyright
1858
=========
1959
Copyright (C) 2017 by IP2Location.com

0 commit comments

Comments
 (0)