Pingme 在线ping探针 支持ICMP TCP和HTTP

241次阅读
没有评论

共计 974 个字符,预计需要花费 3 分钟才能阅读完成。

Pingme是ping探针命令行工具,支持ICMP,TCP和HTTP协议。

您还可以使用它来查询来自第三方api提供程序的IP信息(当前我们使用https://ip-api.com)。

特征

  • 支持ICMP / TCP / HTTP协议
  • 查询基本IP信息

安装

  1. 下载最新版本(推荐)
  2. 使用去得到
go get -u github.com/noobly314/pingme
  1. 自行构建
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文件。

致谢

https://ip-api.com

lmas / icmp_ping.go

sparrc /开始

davecheney / httpstat

正文完
 
admin
版权声明:本站原创文章,由 admin 2019-12-30发表,共计974字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码