class HTTPX::Resolver::HTTPS

  1. lib/httpx/resolver/https.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. <<
  2. closed?
  3. timeout

Included modules

  1. Resolver::ResolverMixin

Constants

DEFAULTS = { uri: NAMESERVER, use_get: false, }.freeze  
NAMESERVER = "https://1.1.1.1/dns-query"  
RECORD_TYPES = { "A" => Resolv::DNS::Resource::IN::A, "AAAA" => Resolv::DNS::Resource::IN::AAAA, }.freeze  

Public Class methods

new (options)
[show source]
   # File lib/httpx/resolver/https.rb
29 def initialize(options)
30   @options = Options.new(options)
31   @resolver_options = Resolver::Options.new(DEFAULTS.merge(@options.resolver_options || {}))
32   @_record_types = Hash.new { |types, host| types[host] = RECORD_TYPES.keys.dup }
33   @queries = {}
34   @requests = {}
35   @connections = []
36   @uri = URI(@resolver_options.uri)
37   @uri_addresses = nil
38 end

Public Instance methods

<< (connection)
[show source]
   # File lib/httpx/resolver/https.rb
40 def <<(connection)
41   @uri_addresses ||= Resolv.getaddresses(@uri.host)
42   if @uri_addresses.empty?
43     ex = ResolveError.new("Can't resolve #{connection.origin.host}")
44     ex.set_backtrace(caller)
45     emit(:error, connection, ex)
46   else
47     early_resolve(connection) || resolve(connection)
48   end
49 end
closed? ()
[show source]
   # File lib/httpx/resolver/https.rb
55 def closed?
56   return true unless @resolver_connection
57 
58   resolver_connection.closed?
59 end
timeout ()
[show source]
   # File lib/httpx/resolver/https.rb
51 def timeout
52   @connections.map(&:timeout).min
53 end