2018-05-21 19:40:46 +01:00
|
|
|
package dnsserver
|
|
|
|
|
|
|
|
|
|
import (
|
2018-05-23 13:50:27 +01:00
|
|
|
"net"
|
2018-05-21 19:40:46 +01:00
|
|
|
|
2018-05-23 13:50:27 +01:00
|
|
|
"github.com/coredns/coredns/plugin/pkg/nonwriter"
|
2018-05-21 19:40:46 +01:00
|
|
|
)
|
|
|
|
|
|
2018-05-23 13:50:27 +01:00
|
|
|
// DoHWriter is a nonwriter.Writer that adds more specific LocalAddr and RemoteAddr methods.
|
|
|
|
|
type DoHWriter struct {
|
|
|
|
|
nonwriter.Writer
|
|
|
|
|
|
|
|
|
|
// raddr is the remote's address. This can be optionally set.
|
|
|
|
|
raddr net.Addr
|
|
|
|
|
// laddr is our address. This can be optionally set.
|
|
|
|
|
laddr net.Addr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RemoteAddr returns the remote address.
|
|
|
|
|
func (d *DoHWriter) RemoteAddr() net.Addr { return d.raddr }
|
|
|
|
|
|
|
|
|
|
// LocalAddr returns the local address.
|
|
|
|
|
func (d *DoHWriter) LocalAddr() net.Addr { return d.laddr }
|