proby 0.2.0

Check whether hosts are reachable on certain ports and return result on HTTP
proby-0.2.0 is not a library.

proby

GitHub Actions Workflow Docker Cloud Build Status AUR Crates.io dependency status license

Check whether hosts are reachable on certain ports and return result on HTTP

Its intended purpose is to be a bridge server for services that can only probe container or application health on HTTP. Oh, and it's just a single binary that works everywhere!

What is this

This tool is a very simple web server that takes requests on HTTP to check whether they are connectable on a provided port. It returns 200 by default if the port is connectable and 503 if it isn't.

Installation

Just grab one of the statically linked builds from the Releases page and you're good to go!

Building

You need a recent Rust nightly installed. It is recommended to use rustup for this.

Then just type

cargo build --release

After the build, a binary will appear here: target/release/proby.

Usage

Run the application using either

cargo run --release

or

target/release/proby

Example request for checking whether port 1337 is connectable on host example.com:

curl localhost:8000/example.com:1337

This will return 200 if it is connectable and 400 if it isn't.

You can also use IPv4s or IPv6s, of course:

curl localhost:8000/8.8.8.8:1337
curl localhost:8000/2001:4860:4860::8888:1337

If you'd like to customize the return codes, you can do so by setting the request parameters good and bad like so:

curl localhost:8000/example.com:1337?good=201&bad=401

You can also configure a timeout (in seconds) using:

curl localhost:8000/example.com:1337?timeout=2

The default timeout is one second.

To change the port this service listens on, specify the ROCKET_PORT environment variable on launch:

ROCKET_PORT=5555 cargo run --release

Releasing

This is mostly a note for me on how to release this thing:

  • Update version in Cargo.toml.
  • git commit and git tag -s, git push.
  • cargo publish
  • Releases will automatically be deployed by Github Actions.
  • Update AUR package.