transport

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0, Apache-2.0 Imports: 21 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

Types is a list of all supported transports

Functions

This section is empty.

Types

type DNSCrypt added in v0.13.0

type DNSCrypt struct {
	ServerStamp string
	TCP         bool // default false (UDP)
	Timeout     time.Duration
	UDPSize     int
	ReuseConn   bool

	// ServerStamp takes precedence if set
	Server       string
	PublicKey    string
	ProviderName string
	// contains filtered or unexported fields
}

func (*DNSCrypt) Close added in v0.13.0

func (d *DNSCrypt) Close() error

func (*DNSCrypt) Exchange added in v0.13.0

func (d *DNSCrypt) Exchange(msg *dns.Msg) (*dns.Msg, error)

type HTTP

type HTTP struct {
	Server       string
	TLSConfig    *tls.Config
	UserAgent    string
	Method       string
	Timeout      time.Duration
	HTTP2, HTTP3 bool
	NoPMTUd      bool
	ReuseConn    bool
	// contains filtered or unexported fields
}

HTTP makes a DNS query over HTTP(s)

func (*HTTP) Close added in v0.12.0

func (h *HTTP) Close() error

func (*HTTP) Exchange added in v0.12.0

func (h *HTTP) Exchange(m *dns.Msg) (*dns.Msg, error)

type ODoH

type ODoH struct {
	Target    string
	Proxy     string
	TLSConfig *tls.Config
	ReuseConn bool
	// contains filtered or unexported fields
}

ODoH makes a DNS query over ODoH

func (*ODoH) Close added in v0.12.0

func (o *ODoH) Close() error

func (*ODoH) Exchange added in v0.12.0

func (o *ODoH) Exchange(m *dns.Msg) (*dns.Msg, error)

type Plain

type Plain struct {
	Server    string
	PreferTCP bool
	Timeout   time.Duration
	UDPBuffer uint16
}

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

func (*Plain) Close added in v0.12.0

func (p *Plain) Close() error

Close is a no-op for the plain transport

func (*Plain) Exchange added in v0.12.0

func (p *Plain) Exchange(m *dns.Msg) (*dns.Msg, error)

type QUIC

type QUIC struct {
	Server          string
	TLSConfig       *tls.Config
	PMTUD           bool
	AddLengthPrefix bool
	ReuseConn       bool
	// contains filtered or unexported fields
}

QUIC makes a DNS query over QUIC

func (*QUIC) Close added in v0.12.0

func (q *QUIC) Close() error

func (*QUIC) Exchange added in v0.12.0

func (q *QUIC) Exchange(msg *dns.Msg) (*dns.Msg, error)

type TLS

type TLS struct {
	Server    string
	TLSConfig *tls.Config
	Timeout   time.Duration
	ReuseConn bool
	// contains filtered or unexported fields
}

TLS makes a DNS query over TLS

func (*TLS) Close added in v0.12.0

func (t *TLS) Close() error

Close closes the TLS connection

func (*TLS) Exchange added in v0.12.0

func (t *TLS) Exchange(msg *dns.Msg) (*dns.Msg, error)

type Transport added in v0.12.0

type Transport interface {
	Exchange(*dns.Msg) (*dns.Msg, error)
	Close() error
}

type Type added in v0.14.0

type Type string
const (
	TypePlain    Type = "plain"
	TypeTCP      Type = "tcp"
	TypeTLS      Type = "tls"
	TypeHTTP     Type = "http"
	TypeQUIC     Type = "quic"
	TypeDNSCrypt Type = "dnscrypt"
)

Jump to

Keyboard shortcuts

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