6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/xclarity_client/discover.rb', line 6
def self.responds?(ipAddress, port)
conf = Faraday.new(url: build_uri(ipAddress, port).to_s) do |faraday|
faraday.request :url_encoded faraday.response :logger, $lxca_log.log faraday.adapter Faraday.default_adapter faraday.ssl[:verify] = false
end
begin
response = conf.get do |req|
req.url RESOURCE
req.options.timeout = 5 req.options.open_timeout = 6 end
rescue Exception
return false
end
return true if %w(200 302).include? response.status.to_s
false
end
|