Pingme是ping探针命令行工具,支持ICMP,TCP和HTTP协议。
您还可以使用它来查询来自第三方api提供程序的IP信息(当前我们使用https://ip-api.com)。
特征
- 支持ICMP / TCP / HTTP协议
- 查询基本IP信息
安装
- 下载最新版本(推荐)
- 使用去得到
go get -u github.com/noobly314/pingme
- 自行构建
git clone https://github.com/noobly314/pingme.git
cd pingme
go build
用法
-h string
HTTP Ping
-i string
ICMP Ping
-m string
MTR Trace
-q string
Query ip information
-t string
TCP Ping
-v Version
例子
$ pingme -h https://www.google.com
Proxy : false
Scheme : https
Host : www.google.com
DNS Lookup: 2.05 ms
TCP : 2.41 ms
TLS : 68.92 ms
Process : 29.28 ms
Transfer : 0.19 ms
Total : 103.06 ms
$ pingme -i www.google.com
ICMP OPEN 74.125.200.147 2.2 ms
$ pingme -t www.google.com:443
TCP OPEN www.google.com:443
$ pingme -q www.google.com
IP : 172.217.194.103
City : Queenstown Estate
Country: Singapore
ISP : Google LLC
AS : AS15169 Google LLC
注意
运行ICMP ping时需要root用户权限,因为它需要打开原始套接字。
您可以使用sudo命令,也可以为pingme设置setuid位。
// Use sudo for one-time ping
$ sudo pingme -i google.com
// Set setuid bit
$ sudo chown root:root pingme
$ sudo chmod u+s pingme
执照
有关许可证权利和限制(MIT),请参阅LICENSE文件。