dohproxy

package module
v0.0.0-...-2a9f06d Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

doh_proxy

CoreDNS plugin to forward requests to a DNS over HTTPS server.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: pluginName,
		Name:      "requests_total",
		Help:      "Counter of requests made per upstream.",
	}, []string{"to"})

	RcodeCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: pluginName,
		Name:      "responses_total",
		Help:      "Counter of responses received per upstream.",
	}, []string{"rcode", "to"})

	RequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: plugin.Namespace,
		Subsystem: pluginName,
		Name:      "request_duration_seconds",
		Buckets:   plugin.TimeBuckets,
		Help:      "Histogram of the time each request took.",
	}, []string{"to", "rcode", "type"})
)

Functions

This section is empty.

Types

type DoHProxy

type DoHProxy struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

DoHProxy is a simplified DNS proxy using a generic upstream interface.

func (*DoHProxy) Name

func (p *DoHProxy) Name() string

Name implements interface for CoreDNS plugin.

func (*DoHProxy) ServeDNS

func (p *DoHProxy) 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, m *dns.Msg) (*dns.Msg, error)
}

Upstream is a simplified interface for proxy destination.

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, r *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
⌂ 换网址