proxy

package
v0.0.0-...-fc01e91 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Log *log.Logger
	// contains filtered or unexported fields
}

Server is a caching DNS proxy that upgrades DNS to DNS over TLS.

func NewServer

func NewServer(mux *dns.ServeMux, log *log.Logger, cacheSize int, evictMetrics bool, minTTL int, addr string, upstreamServers ...string) *Server

NewServer constructs a new server but does not start it, use Run to start it afterwards. Calling New(0) is valid and comes with working defaults: * If cacheSize is 0 a default value will be used. to disable caches use a negative value. * If no upstream servers are specified default ones will be used.

func (*Server) DebugHandler

func (s *Server) DebugHandler() http.Handler

DebugHandler returns an http.Handler that serves debug stats.

func (*Server) GetAnswer

func (s *Server) GetAnswer(q *dns.Msg) *dns.Msg

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run runs the server. The server will gracefully shutdown when context is canceled.

func (*Server) ServeDNS

func (s *Server) ServeDNS(w dns.ResponseWriter, q *dns.Msg)

ServeDNS implements miekg/dns.Handler for Server.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown DNS server

Directories

Path Synopsis
internal
specialized
This example demonstrates a priority queue built using the heap interface.
This example demonstrates a priority queue built using the heap interface.

Jump to

Keyboard shortcuts

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