Created
April 17, 2017 02:47
-
-
Save kirs/161d211730c2b3e38bde90b1e4065056 to your computer and use it in GitHub Desktop.
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 "net/http" | |
require "uri" | |
trap("TERM") do | |
puts 'terminating...' | |
end | |
loop do | |
begin | |
http = Net::HTTP.new("www.google.com", 81) | |
http.open_timeout = 5 | |
http.read_timeout = 5 | |
request = Net::HTTP::Get.new uri | |
http.request request | |
rescue => e | |
puts e.inspect | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment