client

package
v0.0.0-...-0ad0213 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: CC0-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSPacketConn

type DNSPacketConn struct {

	// QueuePacketConn is the direct receiver of ReadFrom and WriteTo calls.
	// recvLoop and sendLoop take the messages out of the receive and send
	// queues and actually put them on the network.
	*turbotunnel.QueuePacketConn
	// contains filtered or unexported fields
}

DNSPacketConn provides a packet-sending and -receiving interface over various forms of DNS. It handles the details of how packets and padding are encoded as a DNS name in the Question section of an upstream query, and as a TXT RR in downstream responses.

DNSPacketConn does not handle the mechanics of actually sending and receiving encoded DNS messages. That is rather the responsibility of some other net.PacketConn such as net.UDPConn, HTTPPacketConn, or TLSPacketConn, one of which must be provided to NewDNSPacketConn.

We don't have a need to match up a query and a response by ID. Queries and responses are vehicles for carrying data and for our purposes don't need to be correlated. When sending a query, we generate a random ID, and when receiving a response, we ignore the ID.

func NewDNSPacketConn

func NewDNSPacketConn(transport net.PacketConn, addr net.Addr, domain dns.Name) *DNSPacketConn

NewDNSPacketConn creates a new DNSPacketConn. transport, through its WriteTo and ReadFrom methods, handles the actual sending and receiving the DNS messages encoded by DNSPacketConn. addr is the address to be passed to transport.WriteTo whenever a message needs to be sent.

type Outbound

type Outbound struct {
	Resolvers     []Resolver
	TunnelServers []TunnelServer
	// contains filtered or unexported fields
}

func NewOutbound

func NewOutbound(resolvers []Resolver, tunnelServers []TunnelServer) *Outbound

func (*Outbound) Start

func (o *Outbound) Start(bind string) error

type Resolver

type Resolver struct {
	ResolverType ResolverType
	ResolverAddr string
}

func NewResolver

func NewResolver(resolverType ResolverType, resolverAddr string) (Resolver, error)

type ResolverType

type ResolverType string
const (
	ResolverTypeUDP ResolverType = "udp"
	ResolverTypeDOT ResolverType = "dot"
	ResolverTypeDOH ResolverType = "doh"
)

type Tunnel

type Tunnel struct {
	Resolver     Resolver
	TunnelServer TunnelServer
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(resolver Resolver, tunnelServer TunnelServer) (*Tunnel, error)

func (*Tunnel) Close

func (t *Tunnel) Close() error

func (*Tunnel) Handle

func (t *Tunnel) Handle(lconn *net.TCPConn) error

func (*Tunnel) InitiateDNSPacketConn

func (t *Tunnel) InitiateDNSPacketConn(domain dns.Name) error

func (*Tunnel) InitiateKCPConn

func (t *Tunnel) InitiateKCPConn(mtu int) error

func (*Tunnel) InitiateNoiseChannel

func (t *Tunnel) InitiateNoiseChannel() error

func (*Tunnel) InitiateResolverConnection

func (t *Tunnel) InitiateResolverConnection() error

func (*Tunnel) InitiateSmuxSession

func (t *Tunnel) InitiateSmuxSession() error

func (*Tunnel) OpenStream

func (t *Tunnel) OpenStream() (net.Conn, error)

type TunnelServer

type TunnelServer struct {
	Addr   dns.Name
	PubKey string
	MTU    int
	// contains filtered or unexported fields
}

func NewTunnelServer

func NewTunnelServer(addr string, pubKeyString string) (TunnelServer, error)

Jump to

Keyboard shortcuts

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