ip17mon

Ip17mon for Java

License

License

GroupId

GroupId

com.qiniu
ArtifactId

ArtifactId

ip17mon
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

ip17mon
Ip17mon for Java
Project URL

Project URL

https://github.com/qiniu/ip17mon-java
Source Code Management

Source Code Management

https://github.com/qiniu/ip17mon-java

Download ip17mon

How to add to project

<!-- https://jarcasting.com/artifacts/com.qiniu/ip17mon/ -->
<dependency>
    <groupId>com.qiniu</groupId>
    <artifactId>ip17mon</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.qiniu/ip17mon/
implementation 'com.qiniu:ip17mon:0.2.2'
// https://jarcasting.com/artifacts/com.qiniu/ip17mon/
implementation ("com.qiniu:ip17mon:0.2.2")
'com.qiniu:ip17mon:jar:0.2.2'
<dependency org="com.qiniu" name="ip17mon" rev="0.2.2">
  <artifact name="ip17mon" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.qiniu', module='ip17mon', version='0.2.2')
)
libraryDependencies += "com.qiniu" % "ip17mon" % "0.2.2"
[com.qiniu/ip17mon "0.2.2"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

IP 17mon java version, 比官方的速度快很多,支持监视文件改动自动加载

IP库请从 ipip.net 下载

添加依赖:

<dependency>
  <groupId>com.qiniu</groupId>
  <artifactId>ip17mon</artifactId>
  <version>0.2.1</version>
</dependency>

使用方法:

首选构建一个 Locator ,支持从不同的地方加载IP库,比如远程URL,或者本地的文件。

//从URL加载IP库
String ipBaseUrl = "http://xxx.example.com/ip.dat";
Locator locator = Locator.loadFromNet(ipBaseUrl);

//从本地加载IP库
String ipBasePath = "/tmp/ip.dat";
Locator locator = Locator.loadFromLocal(ipBasePath);

然后使用 find 方法查询:

LocationInfo ipInfo = locator.find("180.163.159.7");
System.out.println(ipInfo.toString());
com.qiniu

Qiniu Cloud

Connect Data, Redefine Value.

Versions

Version
0.2.2
0.2.1
0.2.0
0.1.2
0.1
0.0.2
0.0.1