pping

command module
v0.0.0-...-9ee683d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2019 License: MIT Imports: 8 Imported by: 0

README

pping - TCP and UDP Pinger

pping (Protocol Ping) is a command line utility that can simulate ICMP-like pings for the TCP and UDP protocols.

Screenshot GIF demo

Installation

macOS
brew tap codeliveroil/apps
brew install pping
Other

Download the latest release for your operating system and machine architecture. If one is not available, you can easily compile from source.

Usage

pping -help
Examples
pping myserver.com 55004
pping -p udp -w 192.168.1.9 40001
pping -d 8.8.8.8 example.com 8080

Library API for GO

import "github.com/codeliveroil/pping/pinger"

...

p := pinger.Pinger{
	Host:        "google.com",
	Port:        80,
	Protocol:    "tcp",
	Wait:        false,
	PayloadSize: 64,
	Interval:    1 * time.Second,
	TTL:         10 * time.Second,
	MaxPings:    5,
	DNSServer:   "",
	Log:         func(msg string) { fmt.Println(msg) },
}

res := &pinger.Result{}
err := p.Ping(res)
if err != nil {
	// handle error
}

fmt.Printf("Received=%d, Dropped=%d, Total=%d\n", res.Received, res.Dropped, res.Received+res.Dropped)

Compile from source

Setup
  1. Install Go
  2. Clone this repository
Build for your current platform
make
make install
Cross compile for a different platform
  1. Build
    make platform
    
  2. Follow the prompts and select a platform
  3. The binary will be available in the build folder

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL