Documentation
¶
Overview ¶
Package doh is the library behind the doh command line: the HTTP client, request shaping, and the typed data models for DNS over HTTPS.
The Client here is the spine every command shares. It sets a real User-Agent, paces requests so a busy session stays polite, and retries the transient failures (429 and 5xx) that any public API throws under load. DNS queries are made to Google's public DoH API (dns.google/resolve).
Index ¶
Constants ¶
const BaseURL = "https://" + Host
BaseURL is the root every request is built from.
const DefaultUserAgent = "doh/dev (+https://github.com/tamnd/doh-cli)"
DefaultUserAgent identifies the client to dns.google.
const Host = "dns.google"
Host is the DNS-over-HTTPS resolver host.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
BaseURL string
// Rate is the minimum gap between requests. Zero means no pacing.
Rate time.Duration
Retries int
// contains filtered or unexported fields
}
Client talks to dns.google over HTTPS.
type Config ¶
Config holds per-client tunables.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns sensible defaults for the DoH client.
type Domain ¶
type Domain struct{}
Domain is the doh driver. It carries no state; the per-run client is built by the factory Register hands kit.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.