Simple Docker container to test if a port works using a Golang server
MIT License
12.8MB container to check a TCP port works with a Golang HTTP server
To test port 1234, use:
docker run -it --rm -p 1234:8000/tcp qmcgaw/port-checker
To test port 1234 internally, use:
docker run -it --rm -e LISTENING_PORT=1234 qmcgaw/port-checker
With a client, access http://localhost:1234. You can also port forward with your router to test it is accessible remotely.
You can also download one of the binaries on the Github releases. 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
# Usage with
./port-checker -help
Environment variable | Default | Possible values | Description |
---|---|---|---|
LISTENING_PORT |
8000 |
1025 to 65535
|
TCP port to listen on internally |
ROOT_URL |
/ |
URL path string | Used if it is running behind a proxy for example |
F1
and select Remote-Containers: Open Folder in Container...