A beautiful, colorful command-line tool written in Go to test TCP connectivity to any host and port. Like ping, but for TCP connections!
✨ Beautiful colored output - Easy to read with color-coded results
⚡ Real-time testing - Continuous monitoring of TCP port connectivity
📊 Statistics - Shows success rate and average latency on exit
🎯 Latency tracking - Color-coded response times (green/yellow/red)
🚀 Simple to use - Just provide IP/hostname and port
🔥 Fast & Lightweight - Written in Go for performance
-
Make sure you have Go installed (1.16+)
-
Clone or download the code, then build:
go build -o tcping main.go- (Optional) Install globally:
go installOr just run directly:
go run main.go <ip/hostname> <port>./tcping <ip/hostname> <port>Or with Go:
go run main.go <ip/hostname> <port>Test Google's DNS server:
./tcping 8.8.8.8 53Test a web server:
./tcping google.com 443Test SSH connectivity:
./tcping 192.168.1.1 22The tool provides:
- ✓ Green checkmarks for successful connections
- ✗ Red X marks for failed connections
- Color-coded latency (green < 50ms, yellow < 150ms, red > 150ms)
- Timestamps for each probe
- Sequence numbers for tracking
- Error messages when connection fails ("Cannot reach destination ip:port")
╔═══════════════════════════════════════╗
║ ⚡ TCPing - TCP Port Tester ⚡ ║
╚═══════════════════════════════════════╝
Target: 8.8.8.8:53
Timeout: 3 seconds
────────────────────────────────────────────────────────────
[14:23:45] ✓ Connected to 8.8.8.8:53 - seq=1 time=25.34ms
[14:23:46] ✓ Connected to 8.8.8.8:53 - seq=2 time=23.12ms
[14:23:47] ✗ Cannot reach destination 192.168.1.99:80 - Timeout
- Ctrl+C - Stop the test and show statistics
When you stop the test (Ctrl+C), you'll see:
- Total number of probes sent
- Successful connections
- Failed connections
- Success rate percentage
- Average latency (if any successful connections)
- Go 1.16 or higher
- github.com/fatih/color (automatically downloaded via
go mod tidy)
# Linux
GOOS=linux GOARCH=amd64 go build -o tcping-linux main.go
# Windows
GOOS=windows GOARCH=amd64 go build -o tcping.exe main.go
# macOS
GOOS=darwin GOARCH=amd64 go build -o tcping-mac main.goFree to use and modify!