TCP Port Check

TCP Port Check

TCP Port Check validates connectivity to a specific TCP port on a target host within a given timeout.

Usage with Binary

./wait4it -type=tcp -h=127.0.0.1 -p=8080 -t=60

Usage with Docker

docker run ph4r5h4d/wait4it -type=tcp -h=127.0.0.1 -p=8080 -t=60

Environment Variables

VariableDescriptionDefault
W4IT_TYPEThe type of check (set to tcp).-
W4IT_TIMEOUTTimeout in seconds.30
W4IT_HOSTThe host to check.127.0.0.1
W4IT_PORTThe TCP port to check.-

Command-Line Arguments

ArgumentDescriptionDefault
-typeThe type of check (set to tcp).-
-tTimeout in seconds.30
-hThe host to check.127.0.0.1
-pThe TCP port to check.-

Notes

  • Environment variables override command-line arguments.
  • Ensure the target host and port are reachable within the timeout period.

Exit Codes

CodeMeaning
0Connection successful.
1Timed out.
2Validation error or incorrect input.