Documentation
¶
Index ¶
- type DNSPacketConn
- type Outbound
- type Resolver
- type ResolverType
- type Tunnel
- func (t *Tunnel) Close() error
- func (t *Tunnel) Handle(lconn *net.TCPConn) error
- func (t *Tunnel) InitiateDNSPacketConn(domain dns.Name) error
- func (t *Tunnel) InitiateKCPConn(mtu int) error
- func (t *Tunnel) InitiateNoiseChannel() error
- func (t *Tunnel) InitiateResolverConnection() error
- func (t *Tunnel) InitiateSmuxSession() error
- func (t *Tunnel) OpenStream() (net.Conn, error)
- type TunnelServer
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
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 (*Tunnel) InitiateDNSPacketConn ¶
func (*Tunnel) InitiateKCPConn ¶
func (*Tunnel) InitiateNoiseChannel ¶
func (*Tunnel) InitiateResolverConnection ¶
func (*Tunnel) InitiateSmuxSession ¶
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)