#public-ip #ip-address #ip #ipify #ipv4 #ipv4-address #publicip

ipfy-public-ip

此包使用ipify获取公网IP,并返回请求的IPv4 IP地址。

3个版本

0.1.2 2023年9月30日
0.1.1 2023年9月27日
0.1.0 2023年9月27日

#3 in #ipify

MIT许可证

4KB

ipfy_public_ip

一个提供find_ip函数的微型crate,该函数将返回请求的公网IP。

文档

这是一个简单易用的微型包。API文档在这里:https://docs.rs/ipfy_public_ip

安装

Cargo.toml

[dependencies]
ipfy-public-ip = "0.1.1"

并在您的crate根目录下

use ipfy_public_ip;

示例

use ipfy_public_ip;

let res = ipfy_public_ip::find_ip();
println!("{}", res);

lib.rs:

ipfy-public-ip

ipfy-public-ip通过IPIFY提供公网IP。

示例

let response = ipfy-public-ip::find_ip();
println!("", response) 
print results 83.83.83.83

依赖关系

~5–18MB
~254K SLoC