forward

package
v0.0.0-...-b5d331f Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package forward contains all the necessary utilities for DNS request forwarding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is the dnscrypt.Handler implementation that forwards DNS requests to the configured upstream.

func NewHandler

func NewHandler(c *HandlerConfig) (h *Handler)

NewHandler returns properly initialized *Handler. c must be non-nil and valid.

func (*Handler) ServeDNS

func (h *Handler) ServeDNS(
	ctx context.Context,
	rw dnscrypt.ResponseWriter,
	r *dns.Msg,
) (err error)

ServeDNS implements the dnscrypt.Handler interface for *Handler.

type HandlerConfig

type HandlerConfig struct {
	// Client is used to execute DNS requests.  It must not be nil.
	Client *dns.Client

	// Address is the upstream address to which requests will be forwarded.  It
	// must not be empty.
	Address netip.AddrPort
}

HandlerConfig is the configuration structure for *Handler.

Jump to

Keyboard shortcuts

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