Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // Address to listen on, ":853" if empty. Addr string // Set to "doq" for DNS-over-QUIC (RFC9250). Net string // QUIC connection configuration. QuicConfig *quic.Config // QUIC Listener to use, this is to aid in systemd's socket activation. Listener quic.Listener // Packet "Listener" to use, this is to aid in systemd's socket activation. PacketConn net.PacketConn // TLS connection configuration. TLSConfig *tls.Config // Handler to invoke, dns.DefaultServeMux if nil. Handler dns.Handler // The read timeout value for new connections, defaults to 2 * time.Second. ReadTimeout time.Duration // The write timeout value for new connections, defaults to zero (will not time out). WriteTimeout time.Duration // An implementation of the dns.TsigProvider interface. If defined it replaces TsigSecret and is used for all TSIG operations. TsigProvider dns.TsigProvider // Secret(s) for Tsig map[<zonename>]<base64 secret>. The zonename must be in canonical form. TsigSecret map[string]string // If NotifyStartedFunc is set it is called once the server has started listening. NotifyStartedFunc func() // Whether to set the SO_REUSEPORT socket option, only used with ListenAndServe. ReusePort bool // AcceptMsgFunc will check the incoming message and will reject it early in the process. // By default dns.DefaultMsgAcceptFunc will be used. MsgAcceptFunc dns.MsgAcceptFunc // contains filtered or unexported fields }
A Server defines parameters for running an DNS-over-QUIC server.
func (*Server) ActivateAndServe ¶
ActivateAndServe starts a DNS-over-QUIC nameserver with the already configured PacketConn or Listener.
Checks if Listener is set, otherwise it will use PacketConn to create a quic.Listener. Returns on error or when Shutdown.
func (*Server) ListenAndServe ¶
ListenAndServe starts a DNS-over-QUIC nameserver on the configured address in *Server.
Returns on error or when Shutdown.
Click to show internal directories.
Click to hide internal directories.