doq

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolError = 0x2
	NoError       = 0x0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler added in v1.8.0

type Handler interface {
	ServeMsg(ctx context.Context, w middleware.Transport, m *dns.Msg)
}

Handler serves one decoded DoQ request through the server's message entry — SDNS's own contract, not the miekg handler machinery.

type ResponseWriter

type ResponseWriter struct {
	Conn   *quic.Conn
	Stream *quic.Stream
}

ResponseWriter is the middleware.Transport for DNS-over-QUIC.

func (*ResponseWriter) Close

func (w *ResponseWriter) Close() error

func (*ResponseWriter) LocalAddr

func (w *ResponseWriter) LocalAddr() net.Addr

func (*ResponseWriter) Proto added in v1.8.0

func (w *ResponseWriter) Proto() string

Proto names the transport for the chain's base writer.

func (*ResponseWriter) RemoteAddr

func (w *ResponseWriter) RemoteAddr() net.Addr

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(m []byte) (int, error)

func (*ResponseWriter) WriteMsg

func (w *ResponseWriter) WriteMsg(m *dns.Msg) error

type Server

type Server struct {
	Addr    string
	Handler Handler
	// contains filtered or unexported fields
}

Server implements DNS-over-QUIC server.

func (*Server) ListenAndServeQUIC

func (s *Server) ListenAndServeQUIC(tlsCert, tlsKey string) error

func (*Server) ListenAndServeQUICWithConfig added in v1.6.0

func (s *Server) ListenAndServeQUICWithConfig(tlsConfig *tls.Config) error

ListenAndServeQUICWithConfig serves with a custom TLS config, binding a new UDP socket at s.Addr. Prefer Serve when the caller already holds a pre-bound socket (e.g. for SO_REUSEPORT or synchronous bind-error reporting).

func (*Server) Serve added in v1.6.4

func (s *Server) Serve(pc net.PacketConn, tlsConfig *tls.Config) error

Serve accepts DoQ connections on a pre-bound UDP PacketConn. It is the preferred entry point when the caller controls the socket lifecycle.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL