transport

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: GPL-3.0, Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DoQNoError          = 0x0        // No error. This is used when the connection or stream needs to be closed, but there is no error to signal.
	DoQInternalError    = 0x1        // The DoQ implementation encountered an internal error and is incapable of pursuing the transaction or the connection.
	DoQProtocolError    = 0x2        // The DoQ implementation encountered a protocol error and is forcibly aborting the connection.
	DoQRequestCancelled = 0x3        // A DoQ client uses this to signal that it wants to cancel an outstanding transaction.
	DoQExcessiveLoad    = 0x4        // A DoQ implementation uses this to signal when closing a connection due to excessive load.
	DoQUnspecifiedError = 0x5        // A DoQ implementation uses this in the absence of a more specific error code.
	DoQErrorReserved    = 0xd098ea5e // Alternative error code used for tests.
)

DoQ Error Codes https://datatracker.ietf.org/doc/html/rfc9250#section-8.4

View Source
const ODoHContentType = "application/oblivious-dns-message"

Variables

View Source
var (
	DoQALPNTokens = []string{"doq"}
)

Functions

func HTTP

func HTTP(
	m *dns.Msg, tlsConfig *tls.Config,
	server, userAgent, method string,
	timeout, handshakeTimeout time.Duration,
	h3, noPMTUD bool) (*dns.Msg, error)

HTTP makes a DNS query over HTTP(s)

func ODoH

func ODoH(query dns.Msg, target, proxy string) (*dns.Msg, error)

ODoH makes a DNS query over ODoH

func Plain

func Plain(m *dns.Msg, server string, preferTCP bool, timeout time.Duration, udpBuffer uint16) (*dns.Msg, error)

Plain makes a DNS query over TCP or UDP (with TCP fallback)

func QUIC

func QUIC(msg *dns.Msg,
	server string,
	tlsConfig *tls.Config,
	dialTimeout, handshakeTimeout, openStreamTimeout time.Duration,
	noPMTUD bool,
	addLengthPrefix bool,
) (*dns.Msg, error)

QUIC makes a DNS query over QUIC

func TLS

func TLS(msg *dns.Msg, server string, tlsConfig *tls.Config, tcpDialTimeout time.Duration) (*dns.Msg, error)

TLS makes a DNS query over TLS

Types

This section is empty.

Jump to

Keyboard shortcuts

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