Documentation ¶
Index ¶
- Constants
- func NewRequest(method, url string, m *dns.Msg) (*http.Request, error)
- func RequestToMsg(req *http.Request) (*dns.Msg, error)
- func ResponseToMsg(resp *http.Response) (*dns.Msg, error)
- type DoHWriter
- func (d *DoHWriter) Close() error
- func (d *DoHWriter) Hijack()
- func (d *DoHWriter) LocalAddr() net.Addr
- func (d *DoHWriter) RemoteAddr() net.Addr
- func (d *DoHWriter) Request() *http.Request
- func (d *DoHWriter) TsigStatus() error
- func (d *DoHWriter) TsigTimersOnly(_ bool)
- func (d *DoHWriter) Write(b []byte) (int, error)
- func (d *DoHWriter) WriteMsg(m *dns.Msg) error
Constants ¶
View Source
const MimeType = "application/dns-message"
MimeType is the DoH mimetype that should be used.
View Source
const Path = "/dns-query"
Path is the URL path that should be used.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
NewRequest returns a new DoH request given a HTTP method, URL and dns.Msg.
The URL should not have a path, so please exclude /dns-query. The URL will be prefixed with https:// by default, unless it's already prefixed with either http:// or https://.
func RequestToMsg ¶
RequestToMsg converts a http.Request to a dns message.
Types ¶
type DoHWriter ¶
type DoHWriter struct { // 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 // Req is the HTTP Req we're currently handling. Req *http.Request // Msg is a response to be written to the client. Msg *dns.Msg }
DoHWriter is a dns.ResponseWriter that adds more specific LocalAddr and RemoteAddr methods.
func (*DoHWriter) RemoteAddr ¶
RemoteAddr returns the remote address.
func (*DoHWriter) TsigStatus ¶
TsigStatus no-op implementation.
func (*DoHWriter) TsigTimersOnly ¶
TsigTimersOnly no-op implementation.
Click to show internal directories.
Click to hide internal directories.