resolver

package
v0.0.0-...-4829b00 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package outbound implements multiple dns client and dispatcher for outbound connection.

  • Copyright (c) 2019 shawn1m. All rights reserved.
  • Use of this source code is governed by The MIT License (MIT) that can be
  • found in the LICENSE file..

Index

Constants

This section is empty.

Variables

View Source
var IdleTimeout = 30 * time.Second
View Source
var InitialCapacity = 0
View Source
var MaxCapacity = 15

Functions

func ExtractDNSAddress

func ExtractDNSAddress(rawAddress string, protocol string) (host string, port string, err error)

ExtractDNSAddress parse all format, return literal IPv6 address

func ExtractFullUrl

func ExtractFullUrl(rawAddress string, protocol string) (string, error)

func ExtractTLSDNSHostName

func ExtractTLSDNSHostName(rawAddress string) (host string, err error)

func ToNetwork

func ToNetwork(protocol string) string

ToNetwork convert dns protocol to network

Types

type BaseResolver

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

func (*BaseResolver) CreateBaseConn

func (r *BaseResolver) CreateBaseConn() (net.Conn, error)

func (*BaseResolver) Exchange

func (r *BaseResolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*BaseResolver) Init

func (r *BaseResolver) Init() error

type HTTP3Resolver

type HTTP3Resolver struct {
	BaseResolver
	// contains filtered or unexported fields
}

func (*HTTP3Resolver) Exchange

func (r *HTTP3Resolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*HTTP3Resolver) Init

func (r *HTTP3Resolver) Init() error

type HTTPSResolver

type HTTPSResolver struct {
	BaseResolver
	// contains filtered or unexported fields
}

func (*HTTPSResolver) Exchange

func (r *HTTPSResolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*HTTPSResolver) Init

func (r *HTTPSResolver) Init() error

type Resolver

type Resolver interface {
	Exchange(*dns.Msg) (*dns.Msg, error)
	Init() error
}

func NewResolver

func NewResolver(u *common.DNSUpstream) Resolver

type TCPResolver

type TCPResolver struct {
	BaseResolver
	// contains filtered or unexported fields
}

func (*TCPResolver) Exchange

func (r *TCPResolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*TCPResolver) Init

func (r *TCPResolver) Init() error

type TCPTLSResolver

type TCPTLSResolver struct {
	BaseResolver
	// contains filtered or unexported fields
}

func (*TCPTLSResolver) Exchange

func (r *TCPTLSResolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*TCPTLSResolver) Init

func (r *TCPTLSResolver) Init() error

type UDPResolver

type UDPResolver struct {
	BaseResolver
}

func (*UDPResolver) Exchange

func (r *UDPResolver) Exchange(q *dns.Msg) (*dns.Msg, error)

func (*UDPResolver) Init

func (r *UDPResolver) Init() error

Jump to

Keyboard shortcuts

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