A modern HTTP and TCP ping utility written in Rust. Piing provides multiple measurement methods to accurately test network connectivity and latency when ICMP packets are not available.
- TCP Connect Mode: Most accurate ping-like measurement using raw TCP connections
- HTTP GET/HEAD Requests: Traditional HTTP-based connectivity testing
- Colorized Output: Visual feedback with color-coded response times
- Flexible Timing: Human-readable interval parsing (e.g., "1s", "500ms", "2.5s")
- Multiple Protocols: Support for HTTP and HTTPS with automatic detection
- Rust (latest stable version)
git clone https://github.com/AAFC-Cloud/piing
cd piing
cargo build --releaseThe executable will be available at target/release/piing.exe.
piing google.compiing google.com --tcppiing google.com --headpiing google.com --interval 500mspiing google.com --tcp --port 443piing https://example.com --tcp --port 443 --interval 2s| Option | Short | Description |
|---|---|---|
--tcp |
Use TCP connect for most accurate ping-like measurement | |
--head |
Use HTTP HEAD instead of GET (no response body) | |
--interval |
-i |
Refresh interval (e.g., "1s", "500ms", "2.5s") |
--port |
-p |
Port to use for TCP ping (default: 80 for HTTP, 443 for HTTPS) |
--help |
-h |
Show help information |
The utility displays timestamped results with color-coded response times:
- Green: Response time < 100ms
- Yellow: Response time 100-500ms
- Red: Response time > 500ms
TCP pinging google.com:443 every 1s
Thu, 12 Jun 2025 08:48:10 -0400 - TCP Connect: SUCCESS - Duration: 29.2ms
Thu, 12 Jun 2025 08:48:11 -0400 - TCP Connect: SUCCESS - Duration: 28.3ms
Thu, 12 Jun 2025 08:48:12 -0400 - TCP Connect: SUCCESS - Duration: 33.5ms
- Most accurate for ping-like measurements
- Measures only network + TCP handshake time
- Excludes HTTP/TLS overhead and server processing
- Closest equivalent to ICMP ping when ICMP is unavailable
- More accurate than GET requests
- Includes TLS handshake but no response body download
- Good balance between accuracy and protocol compliance
- Full HTTP request/response cycle
- Includes all network, TLS, HTTP, and server processing overhead
- Useful for testing complete application stack
Copyright belongs to © His Majesty the King in Right of Canada, as represented by the Minister of Agriculture and Agri-Food, 2025.