Last active
November 12, 2021 14:10
-
-
Save jjb/4cb6888dcf64d2df3f9ca589cfc2d8a8 to your computer and use it in GitHub Desktop.
Use ruby to test if a port is available on a host, similar to telnet foo 123
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
Socket.tcp("example.com", 443, connect_timeout: 1).close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment