doh

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func NewRequest(method, url string, m *dns.Msg) (*http.Request, error)

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

func RequestToMsg(req *http.Request) (*dns.Msg, error)

RequestToMsg converts a http.Request to a dns message.

func RequestToMsgWire

func RequestToMsgWire(req *http.Request) (*dns.Msg, []byte, error)

RequestToMsgWire converts a http.Request to a dns message and returns the original DNS wire bytes from the request.

func ResponseToMsg

func ResponseToMsg(resp *http.Response) (*dns.Msg, error)

ResponseToMsg converts a http.Response to a dns message.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL