diff --git a/server.go b/server.go index d52cceaa..0562960a 100644 --- a/server.go +++ b/server.go @@ -32,6 +32,9 @@ type ResponseWriter interface { TsigStatus() error // TsigTimersOnly sets the tsig timers only boolean. TsigTimersOnly(bool) + // Hijack lets the caller take over the connection. + // After a call to Hijack(), the DNS package will not do anything with the connection + Hijack() } type conn struct { @@ -417,6 +420,9 @@ func (w *response) TsigStatus() error { return w.tsigStatus } // TsigTimersOnly implements the ResponseWriter.TsigTimersOnly method. func (w *response) TsigTimersOnly(b bool) { w.tsigTimersOnly = b } +// Hijack implements the ResponseWriter.Hijack method. +func (w *response) Hijack() { w.hijacked = true } + // Close implements the ResponseWriter.Close method func (w *response) Close() error { if w.conn._UDP != nil {