Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// Addr specifies the TCP/UDP address to listen to, :53 if empty.
Addr string
// Upstream specifies the resolver used for incoming queries.
Upstream resolver.Resolver
// BogusPriv specifies that reverse lookup on private subnets are answerd
// with NXDOMAIN.
BogusPriv bool
// Timeout defines the maximum allowed time allowed for a request before
// being cancelled.
Timeout time.Duration
// QueryLog specifies an optional log function called for each received query.
QueryLog func(QueryInfo)
// ErrorLog specifies an optional log function for errors. If not set,
// errors are not reported.
ErrorLog func(error)
}
Proxy is a DNS53 to DNS over anything proxy.
func (Proxy) ListenAndServe ¶
ListenAndServe listens on UDP and TCP and serve DNS queries. If ctx is canceled, listeners are closed and ListenAndServe returns context.Canceled error.
Click to show internal directories.
Click to hide internal directories.