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
+118-2
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,19 @@ This component allows user to query an IP address if it was being used as VPN an
5
5
* Free IP2Proxy BIN Data: https://lite.ip2location.com
6
6
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/database/ip2proxy
7
7
8
+
As an alternative, this component can also call the IP2Proxy Web Service. This requires an API key. If you don't have an existing API key, you can subscribe for one at the below:
9
+
10
+
https://www.ip2location.com/web-service/ip2proxy
11
+
8
12
## Compilation
9
13
10
14
```bash
11
15
javac com/ip2proxy/*.java
12
16
jar cf ip2proxy.jar com/ip2proxy/*.class
13
17
```
14
18
19
+
## QUERY USING THE BIN FILE
20
+
15
21
## Methods
16
22
Below are the methods supported in this class.
17
23
@@ -144,10 +150,120 @@ public class Main {
144
150
}
145
151
Proxy.Close();
146
152
}
147
-
catch(ExceptionEx) {
148
-
System.out.println(Ex);
153
+
catch(Exceptione) {
154
+
System.out.println(e);
149
155
}
150
156
}
151
157
}
152
158
```
153
159
160
+
## QUERY USING THE IP2PROXY PROXY DETECTION WEB SERVICE
161
+
162
+
## Methods
163
+
Below are the methods supported in this class.
164
+
165
+
|Method Name|Description|
166
+
|---|---|
167
+
|Open(String APIKey, String Package, boolean UseSSL)| Expects 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li></li><li>Use HTTPS or HTTP</li></ol>|
168
+
|IPQuery(String IPAddress)|Query IP address. This method returns a JsonObject containing the proxy info. <ul><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li><ul>|
169
+
|GetCredit()|This method returns the web service credit balance in a JsonObject.|
170
+
171
+
## Usage
172
+
173
+
```java
174
+
importcom.ip2proxy.*;
175
+
importcom.google.gson.*;
176
+
177
+
publicclassMain {
178
+
publicMain() {
179
+
}
180
+
181
+
publicstaticvoidmain(String[] args) {
182
+
try
183
+
{
184
+
IP2ProxyWebService ws =newIP2ProxyWebService();
185
+
186
+
String strIPAddress ="8.8.8.8";
187
+
String strAPIKey ="YOUR_API_KEY";
188
+
String strPackage ="PX11";
189
+
boolean boolSSL =true;
190
+
191
+
ws.Open(strAPIKey, strPackage, boolSSL);
192
+
193
+
JsonObject myresult =ws.IPQuery(strIPAddress);
194
+
195
+
if ((myresult.get("response") !=null) && (myresult.get("response").getAsString().equals("OK")))
0 commit comments