forward

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Unlicense Imports: 5 Imported by: 0 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.

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