Using net http ping


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # encoding = utf-8
  2.  
  3. require 'net/ping'
  4.  
  5. Net::Ping::HTTP.new('http://example.com') do |http|
  6. http.ping ? puts('ok!')
  7. : puts(http.exception)
  8. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.