transport

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: LGPL-2.1 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixedResponse

func FixedResponse(id uint16, question dns.Question, addresses []netip.Addr, timeToLive uint32) *dns.Msg

Types

type LocalTransport

type LocalTransport struct {
	// contains filtered or unexported fields
}

func NewLocalTransport

func NewLocalTransport(options *LocalTransportOptions) *LocalTransport

func (*LocalTransport) Exchange

func (t *LocalTransport) Exchange(ctx context.Context, message *dns.Msg) (*dns.Msg, error)

type LocalTransportOptions

type LocalTransportOptions struct {
	Dialer dialer.Dialer
	Host   *hosts.File
}

type TCPTransport

type TCPTransport struct {
	// contains filtered or unexported fields
}

func NewTCPTransport

func NewTCPTransport(server addrs.Socksaddr, options TCPTransportOptions) (*TCPTransport, error)

func (*TCPTransport) Exchange

func (t *TCPTransport) Exchange(ctx context.Context, message *dns.Msg) (*dns.Msg, error)

type TCPTransportOptions

type TCPTransportOptions struct {
	Dialer dialer.Dialer
}

type Transport

type Transport interface {
	Exchange(ctx context.Context, message *dns.Msg) (*dns.Msg, error)
}

type UDPTransport

type UDPTransport struct {
	// contains filtered or unexported fields
}

func NewUDP

func NewUDP(server addrs.Socksaddr, options UDPTransportOptions) *UDPTransport

func (*UDPTransport) Close

func (t *UDPTransport) Close() error

func (*UDPTransport) Exchange

func (t *UDPTransport) Exchange(ctx context.Context, message *dns.Msg) (*dns.Msg, error)

type UDPTransportOptions

type UDPTransportOptions struct {
	Dialer dialer.Dialer
}

Jump to

Keyboard shortcuts

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