Skip to content

marcodevqc/tcping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

TCPing - Colorful TCP Port Tester ⚡

A beautiful, colorful command-line tool written in Go to test TCP connectivity to any host and port. Like ping, but for TCP connections!

Features

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

Installation

Build from source

  1. Make sure you have Go installed (1.16+)

  2. Clone or download the code, then build:

go build -o tcping main.go
  1. (Optional) Install globally:
go install

Or just run directly:

go run main.go <ip/hostname> <port>

Usage

./tcping <ip/hostname> <port>

Or with Go:

go run main.go <ip/hostname> <port>

Examples

Test Google's DNS server:

./tcping 8.8.8.8 53

Test a web server:

./tcping google.com 443

Test SSH connectivity:

./tcping 192.168.1.1 22

Output

The 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")

Sample Output

╔═══════════════════════════════════════╗
║  ⚡ 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

Controls

  • Ctrl+C - Stop the test and show statistics

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)

Requirements

  • Go 1.16 or higher
  • github.com/fatih/color (automatically downloaded via go mod tidy)

Building for Different Platforms

# 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.go

License

Free to use and modify!

About

TCP Service Ping Tool

Topics

Resources

Stars

Watchers

Forks

Languages