port-checker

command module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 14 Imported by: 0

README

Port Checker with Docker

12.8MB container to check a TCP port works with a Golang HTTP server

Build status Docker Pulls Docker Stars

GitHub last commit GitHub commit activity GitHub issues

Features

  • Listening address configurable
  • Root URL configurable - useful to test reverse proxies
  • HTTP server responding with information on your client:
    • Client IP (public or private)
    • Browser and version
    • Device type
    • OS and version
  • Lightweight program of around 8MB
  • Docker image is compatible with amd64, 386, arm64, arm/v6, arm/v7, s390x, ppc64le and riscv64
  • Standalone binaries pre-built for each release for Linux (amd64, 386, arm64), Darwin (amd64, arm64) and Windows (amd64, 386, arm64)

Standalone binary

You can download one of the binaries attached with each Github release. For example:

wget -qO port-checker https://github.com/qdm12/port-checker/releases/download/v0.1.0/port-checker_0.1.0_linux_amd64
chmod +x port-checker
./port-checker --listening-address=":8000" --root-url="/"

You can build the binary for a specific platform if it's not listed using for example:

CGO_ENALBED=0 GOARCH=amd64 go build -o port-checker github.com/qdm12/port-checker

Docker image

To test port 1234, use:

docker run --rm -p 1234:8000/tcp qmcgaw/port-checker

To test port 1234 internally, use:

docker run --rm -e LISTENING_ADDRESS=":1234" qmcgaw/port-checker

💁 There are also image tags, such as :v0.1.0, corresponding to each tagged release.

Options

Environment variable Flag Default Possible values Description
LISTENING_ADDRESS --listening-address :8000 Valid listening address TCP address to listen on internally
ROOT_URL --root-url / URL path string Used if it is running behind a proxy for example

TO DOs

  • Use GeoLite database and Google Maps to show the location
  • Add CSS to the HTML template
  • Precise external mapped port to check it can access itself at start
  • Unit testing
  • Notifications (Pushbullet, email, etc. ?)
  • UDP port check, see this

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
server
Package server runs the HTTP server for the program.
Package server runs the HTTP server for the program.

Jump to

Keyboard shortcuts

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