Class: HTTPX::Resolver::HTTPS
- Extended by:
- Forwardable
- Defined in:
- lib/httpx/resolver/https.rb,
sig/resolver/https.rbs
Overview
Implementation of a DoH name resolver (https://www.youtube.com/watch?v=unMXvnY2FNM). It wraps an HTTPX::Connection object which integrates with the main session in the same manner as other performed HTTP requests.
Defined Under Namespace
Modules: DNSExtensions
Constant Summary collapse
- NAMESERVER =
"https://1.1.1.1/dns-query"- DEFAULTS =
{ uri: NAMESERVER, use_get: false, }.freeze
- FAMILY_TYPES =
Constants inherited from Resolver
Constants included from Loggable
Loggable::COLORS, Loggable::USE_DEBUG_LOG
Instance Attribute Summary collapse
-
#family ⇒ ip_family
readonly
Returns the value of attribute family.
-
#pool ⇒ Object
writeonly
Sets the attribute pool.
Attributes inherited from Resolver
#current_selector, #current_session, #multi, #options
Instance Method Summary collapse
- #<<(connection) ⇒ void
- #call ⇒ void
- #close ⇒ void
- #closed_for_select? ⇒ Boolean
-
#connecting? ⇒ Boolean
delegated to resolver connection.
- #deactivate ⇒ void
- #handle_socket_timeout ⇒ void
- #inflight? ⇒ Boolean
- #state ⇒ Object
- #terminate ⇒ void
- #to_io ⇒ IO
Methods inherited from Resolver
#closed?, #each_connection, #early_resolve, #emit_addresses, #empty?, #force_close, #handle_error, #initial_call, #lazy_resolve, multi?, #on_error, #on_io_error
Methods included from Loggable
#log, #log_exception, log_identifiers
Methods included from _Selectable
#force_close, #initial_call, #interests, #on_error, #on_io_error, #timeout
Instance Attribute Details
#family ⇒ ip_family (readonly)
Returns the value of attribute family.
11 12 13 |
# File 'sig/resolver/https.rbs', line 11 def family @family end |
#pool=(value) ⇒ Object (writeonly)
Sets the attribute pool
25 26 27 |
# File 'sig/resolver/https.rbs', line 25 def pool=(value) @pool = value end |
Instance Method Details
#<<(connection) ⇒ void
This method returns an undefined value.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/httpx/resolver/https.rb', line 56 def <<(connection) return if @uri.origin == connection.peer.to_s @uri_addresses ||= @options.resolver_cache.resolve(@uri.host) || @resolver.getaddresses(@uri.host) if @uri_addresses.empty? ex = ResolveError.new("Can't resolve DNS server #{@uri.host}") ex.set_backtrace(caller) connection.force_close throw(:resolve_error, ex) end resolve(connection) end |
#call ⇒ void
This method returns an undefined value.
34 |
# File 'sig/resolver/https.rbs', line 34
def call: () -> void
|
#close ⇒ void
This method returns an undefined value.
36 |
# File 'sig/resolver/https.rbs', line 36
def close: () -> void
|
#closed_for_select? ⇒ Boolean
40 |
# File 'sig/resolver/https.rbs', line 40
def closed_for_select?: () -> bool
|
#connecting? ⇒ Boolean
delegated to resolver connection
30 |
# File 'sig/resolver/https.rbs', line 30
def connecting?: () -> bool
|
#deactivate ⇒ void
This method returns an undefined value.
42 |
# File 'sig/resolver/https.rbs', line 42
def deactivate: () -> void
|
#handle_socket_timeout ⇒ void
This method returns an undefined value.
48 |
# File 'sig/resolver/https.rbs', line 48
def handle_socket_timeout: (interval interval) -> void
|
#inflight? ⇒ Boolean
46 |
# File 'sig/resolver/https.rbs', line 46
def inflight?: () -> bool
|
#state ⇒ Object
52 53 54 |
# File 'lib/httpx/resolver/https.rb', line 52 def state @resolver_connection&.state || :idle end |
#terminate ⇒ void
This method returns an undefined value.
44 |
# File 'sig/resolver/https.rbs', line 44
def terminate: () -> void
|
#to_io ⇒ IO
32 |
# File 'sig/resolver/https.rbs', line 32
def to_io: () -> IO
|