Skip to content

cognilabz/ping-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ping-proxy

ping-proxy is a small Go service that exposes ICMP ping checks over HTTP or HTTPS for literal IPv4 and IPv6 addresses.

For the full product and implementation contract, see SPEC.md.

Run

The service requires Basic Auth credentials at startup.

export PING_PROXY_BASIC_AUTH_USERNAME=ping
export PING_PROXY_BASIC_AUTH_PASSWORD=change-me
go run ./cmd/ping-proxy

By default, plain HTTP listens on port 8080. When TLS is enabled, HTTPS listens on port 8443.

When running in a container, ICMP probing typically requires NET_RAW:

docker run --rm --cap-add=NET_RAW \
  -e PING_PROXY_BASIC_AUTH_USERNAME=ping \
  -e PING_PROXY_BASIC_AUTH_PASSWORD=change-me \
  -p 8080:8080 ping-proxy

Example Request

curl -u ping:change-me \
  -H 'Content-Type: application/json' \
  -d '{
    "targets": ["8.8.8.8", "2001:4860:4860::8888"],
    "retries": 2
  }' \
  http://localhost:8080/ping

Example Response

{
  "results": [
    {
      "target": "8.8.8.8",
      "reachable": true
    },
    {
      "target": "2001:4860:4860::8888",
      "reachable": false
    }
  ]
}

Compact responses are returned by default. Set "compact": false in the request body when full per-target probe details are needed.

About

A HTTP(s) to ICMP-ping proxy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors