Update README

This commit is contained in:
i3h 2020-07-21 16:09:41 +08:00
parent ad65746305
commit 6f55d63cd7

View File

@ -16,14 +16,14 @@ You can also use it to query IP information from [https://ifconfig.is](https://i
2. Use go get 2. Use go get
``` ```
go get -u github.com/i3h/tcping go get -u github.com/i3h/tcping/cmd/tcping
``` ```
3. Build on your own 3. Build on your own
``` ```
git clone https://github.com/i3h/tcping.git git clone https://github.com/i3h/tcping.git
cd tcping cd tcping/cmd/tcping
go build go build
``` ```
@ -45,36 +45,68 @@ go build
# Examples # Examples
``` ```bash
$ tcping -h https://www.google.com # Test port
$ tcping google.com 443
TCP OPEN [2404:6800:4003:c03::71]:443
# Test with protocol
$ tcping https://google.com
Continent: North America
Country : United States
Latitude : 37.751000
Longitude: -97.822000
TimeZone : America/Chicago
IsEU : false
ASN : 15169
ORG : GOOGLE
Proxy : false Proxy : false
Scheme : https Scheme : https
Host : www.google.com Host : google.com
DNS Lookup: 2.05 ms DNS Lookup: 0.85 ms
TCP : 2.41 ms TCP : 1.62 ms
TLS : 68.92 ms TLS : 3.11 ms
Process : 29.28 ms Process : 32.91 ms
Transfer : 0.19 ms Transfer : 0.15 ms
Total : 103.06 ms Total : 38.72 ms
```
``` # HTTP ping
$ tcping -i www.google.com $ tcping -h https://google.com
ICMP OPEN 74.125.200.147 2.2 ms
```
``` Proxy : false
$ tcping -t www.google.com:443 Scheme : https
TCP OPEN www.google.com:443 Host : google.com
``` DNS Lookup: 0.92 ms
TCP : 1.71 ms
TLS : 2.99 ms
Process : 32.24 ms
Transfer : 0.14 ms
Total : 38.10 ms
``` # ICMP ping
$ tcping -q www.google.com $ tcping -i google.com
IP : 172.217.194.103
City : Queenstown Estate ICMP OPEN 172.217.194.113 2.0 ms
Country: Singapore
ISP : Google LLC # Query IP info
AS : AS15169 Google LLC $ tcping -q google.com
Continent: North America
Country : United States
Latitude : 37.751000
Longitude: -97.822000
TimeZone : America/Chicago
IsEU : false
ASN : 15169
ORG : GOOGLE
# Test port
$ tcping -t google.com:443
TCP OPEN google.com:443
``` ```
# Note # Note
@ -83,11 +115,11 @@ Root permission is required when running ICMP ping, since it needs to open raw s
You can either use sudo command, or set setuid bit for tcping. You can either use sudo command, or set setuid bit for tcping.
``` ```bash
// Use sudo for one-time ping # Use sudo for one-time ping
$ sudo tcping -i google.com $ sudo tcping -i google.com
// Set setuid bit # Set setuid bit
$ sudo chown root:root tcping $ sudo chown root:root tcping
$ sudo chmod u+s tcping $ sudo chmod u+s tcping