tunneldns

package
v0.0.0-...-b9898a9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LogFieldAddress         = "address"
	LogFieldURL             = "url"
	MaxUpstreamConnsDefault = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

Listener is an adapter between CoreDNS server and Warp runnable

func CreateListener

func CreateListener(address string, port uint16, upstreams []string, bootstraps []string, maxUpstreamConnections int, log *zerolog.Logger) (*Listener, error)

CreateListener configures the server and bound sockets

func (*Listener) Start

func (l *Listener) Start(readySignal chan struct{}) error

Start blocks for serving requests

func (*Listener) Stop

func (l *Listener) Stop() error

Stop signals server shutdown and blocks until completed

type MetricsPlugin

type MetricsPlugin struct {
	Next plugin.Handler
}

MetricsPlugin is an adapter for CoreDNS and built-in metrics

func NewMetricsPlugin

func NewMetricsPlugin(next plugin.Handler) *MetricsPlugin

NewMetricsPlugin creates a plugin with configured metrics

func (MetricsPlugin) Name

func (p MetricsPlugin) Name() string

Name implements the CoreDNS plugin interface

func (MetricsPlugin) ServeDNS

func (p MetricsPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the CoreDNS plugin interface

type ProxyPlugin

type ProxyPlugin struct {
	Upstreams []Upstream
	Next      plugin.Handler
}

ProxyPlugin is a simplified DNS proxy using a generic upstream interface

func (ProxyPlugin) Name

func (p ProxyPlugin) Name() string

Name implements interface for CoreDNS plugin

func (ProxyPlugin) ServeDNS

func (p ProxyPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements interface for CoreDNS plugin

type Upstream

type Upstream interface {
	Exchange(ctx context.Context, query *dns.Msg) (*dns.Msg, error)
}

Upstream is a simplified interface for proxy destination

func NewUpstreamHTTPS

func NewUpstreamHTTPS(endpoint string, bootstraps []string, maxConnections int, log *zerolog.Logger) (Upstream, error)

NewUpstreamHTTPS creates a new DNS over HTTPS upstream from endpoint

type UpstreamHTTPS

type UpstreamHTTPS struct {
	// contains filtered or unexported fields
}

UpstreamHTTPS is the upstream implementation for DNS over HTTPS service

func (*UpstreamHTTPS) Exchange

func (u *UpstreamHTTPS) Exchange(ctx context.Context, query *dns.Msg) (*dns.Msg, error)

Exchange provides an implementation for the Upstream interface

Jump to

Keyboard shortcuts

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