Documentation ¶
Overview ¶
Package rewrite is middleware for rewriting requests internally to something different.
Package rewrite is middleware for rewriting requests internally to something different.
Index ¶
Constants ¶
const ( Is = "is" Not = "not" Has = "has" NotHas = "not_has" StartsWith = "starts_with" EndsWith = "ends_with" Match = "match" NotMatch = "not_match" )
Operators
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseReverter ¶
type ResponseReverter struct { dns.ResponseWriter // contains filtered or unexported fields }
ResponseReverter reverses the operations done on the question section of a packet. This is need because the client will otherwise disregards the response, i.e. dig will complain with ';; Question section mismatch: got miek.nl/HINFO/IN'
func NewResponseReverter ¶
func NewResponseReverter(w dns.ResponseWriter, r *dns.Msg) *ResponseReverter
NewResponseReverter returns a pointer to a new ResponseReverter.
func (*ResponseReverter) Hijack ¶
func (r *ResponseReverter) Hijack()
Hijack implements dns.Hijacker. It simply wraps the underlying ResponseWriter's Hijack method if there is one, or returns an error.
type Rewrite ¶
type Rewrite struct { Next middleware.Handler Rules []Rule // contains filtered or unexported fields }
Rewrite is middleware to rewrite requests internally before being handled.