preservice

package
v0.0.0-...-b6e3791 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package preservice contains the middleware that comes right before the main filtering middleware of DNS service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Messages is used to construct TXT responses.
	Messages *dnsmsg.Constructor

	// HashMatcher is the safe browsing DNS hashMatcher.
	HashMatcher filter.HashMatcher

	// Checker is used to detect and process DNS-check requests.
	Checker dnscheck.Interface
}

Config is the configurational structure for the preservice middleware. All fields must be non-nil.

type Middleware

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

Middleware is a middleware that comes right before the main filtering middleware of DNS service. It includes handling of TXT queries for domain names that may be filtered by safe browsing or parental control filters as well as handling of the DNS-server check queries.

func New

func New(c *Config) (mw *Middleware)

New returns a new preservice middleware. c must not be nil.

func (*Middleware) Wrap

func (mw *Middleware) Wrap(next dnsserver.Handler) (wrapped dnsserver.Handler)

Wrap implements the dnsserver.Middleware interface for *Middleware.

Jump to

Keyboard shortcuts

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