Go to file
i3h 8fc8cf2d39 Change Query API
New Query API is https://ifconfig.is/json
The IP data is provided by MaxMind.
2020-05-24 02:18:36 +00:00
.github/workflows change repo name 2020-05-11 22:38:50 +08:00
httping first release 2020-05-11 22:18:16 +08:00
mtr first release 2020-05-11 22:18:16 +08:00
ping first release 2020-05-11 22:18:16 +08:00
tcping first release 2020-05-11 22:18:16 +08:00
.gitignore change repo name 2020-05-11 22:38:50 +08:00
flag.go first release 2020-05-11 22:18:16 +08:00
go.mod change repo name 2020-05-11 22:38:50 +08:00
go.sum change repo name 2020-05-11 22:38:50 +08:00
LICENSE.md first release 2020-05-11 22:18:16 +08:00
log.go Change Query API 2020-05-24 02:18:36 +00:00
main.go change repo name 2020-05-11 22:38:50 +08:00
query.go Change Query API 2020-05-24 02:18:36 +00:00
README.md change repo name 2020-05-11 22:38:50 +08:00
util.go first release 2020-05-11 22:18:16 +08:00

Introduction

TCPING is ping probe command line tool, supporting ICMP, TCP and HTTP protocols.

You can also use it to query IP information from third-party api provider (currently we use https://ip-api.com).

Features

  • Support ICMP/TCP/HTTP protocols
  • Query basic IP information

Installation

  1. Download latest release (recommend)

  2. Use go get

go get -u github.com/i3h/tcping
  1. Build on your own
git clone https://github.com/i3h/tcping.git
cd tcping
go build

Usage

  -h string
        HTTP Ping
  -i string
        ICMP Ping
  -m string
        MTR Trace
  -q string
        Query ip information
  -t string
        TCP Ping
  -v    Version

Examples

$ tcping -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
$ tcping -i www.google.com
ICMP   OPEN      74.125.200.147    2.2 ms
$ tcping -t www.google.com:443
TCP    OPEN      www.google.com:443
$ tcping -q www.google.com
IP     :    172.217.194.103
City   :    Queenstown Estate
Country:    Singapore
ISP    :    Google LLC
AS     :    AS15169 Google LLC

Note

Root permission is required when running ICMP ping, since it needs to open raw socket.

You can either use sudo command, or set setuid bit for tcping.

// Use sudo for one-time ping
$ sudo tcping -i google.com

// Set setuid bit
$ sudo chown root:root tcping
$ sudo chmod u+s tcping

License

See the LICENSE file for license rights and limitations (MIT).

Acknowledgements

https://ip-api.com

lmas/icmp_ping.go

sparrc/go-ping

davecheney/httpstat