Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple program to help you react more quickly to servers and services coming back online.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.markdown
Octocat-spinner-32 waitforsocket.go

This is a simple go program that waits for a remote socket to become available. It's useful to avoid guessing when a service comes back up, etc...


Assuming you have a recent go compiler installed and working correctly, you can install waitforsocket with the following command:

go get


waitforsocket somehost:22 ; ssh somehost

You can wait for multiple hosts in a similar way:

waitforsocket somehost:22 otherhost:22

If you want to be fancy, you can look for a variety of hosts, and be satisfied when any one of them works (e.g. am I on the internet?):

waitforsocket -required=1 www.{yahoo,google,microsoft}.com:80
Something went wrong with that request. Please try again.