Documentation
¶
Index ¶
- Constants
- func NewRequest(method, url string, m *dns.Msg) (*http.Request, error)
- func NewRequestWithContext(ctx context.Context, method, url string, m *dns.Msg) (*http.Request, error)
- func RequestToMsg(req *http.Request) (*dns.Msg, error)
- func RequestToMsgWire(req *http.Request) (*dns.Msg, []byte, error)
- func ResponseToMsg(resp *http.Response) (*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 NewRequestWithContext ¶ added in v1.14.5
func RequestToMsg ¶
RequestToMsg converts a http.Request to a dns message.
func RequestToMsgWire ¶ added in v1.14.3
RequestToMsgWire converts a http.Request to a dns message and returns the original DNS wire bytes from the request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.