filterresponse

package module
v0.0.0-...-226fcbb Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterResponse

type FilterResponse struct {
	Next    plugin.Handler
	Filters []*net.IPNet
}

Rewrite is plugin to rewrite requests internally before being handled.

func (FilterResponse) Name

func (fr FilterResponse) Name() string

Name implements the Handler interface.

func (FilterResponse) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

type ResponseModifier

type ResponseModifier struct {
	dns.ResponseWriter
	*FilterResponse
}

func NewResponseModifier

func NewResponseModifier(w dns.ResponseWriter, fr *FilterResponse) *ResponseModifier

Returns a dns.Msg modifier that replaces CNAME on root zones with other records.

func (*ResponseModifier) Write

func (r *ResponseModifier) Write(buf []byte) (int, error)

Write is a wrapper that records the size of the message that gets written.

func (*ResponseModifier) WriteMsg

func (r *ResponseModifier) WriteMsg(res *dns.Msg) error

WriteMsg records the status code and calls the underlying ResponseWriter's WriteMsg method.

Jump to

Keyboard shortcuts

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