Documentation ¶
Index ¶
- Variables
- func DOHJsonAPI(DNSServer, domain string, ...) (DNS []net.IP, err error)
- func New(config Config) (dns.DNS, error)
- func NewClient(config Config, send func(context.Context, []byte) ([]byte, error)) *client
- func NewDnsServer(server string, process dns.DNS) server.DNSServer
- func NewDoH(config Config) (dns.DNS, error)
- func NewDoH3(config Config) (dns.DNS, error)
- func NewDoQ(config Config) (dns.DNS, error)
- func NewDoT(config Config) (dns.DNS, error)
- func NewDoU(config Config) (dns.DNS, error)
- func NewTCP(config Config) (dns.DNS, error)
- func ParseAddr(netType statistic.Type, host, defaultPort string) (proxy.Address, error)
- func Register(tYPE pd.Type, f func(Config) (dns.DNS, error))
- func RetrieveIPFromPtr(name string) (net.IP, error)
- type Answer
- type Config
- type DOHJson
- type FakeDNS
- type FakeIPPool
- type Question
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCondEmptyResponse = errors.New("can't get response from cond")
View Source
var ErrNoIPFound = errors.New("no ip found")
View Source
var TlsProtos = []string{"doq-i02"}
View Source
var TlsProtosCompat = []string{"doq-i02", "doq-i01", "doq-i00", "doq", "dq"}
TlsProtosCompat stores alternative TLS protocols for experimental interoperability
Functions ¶
func DOHJsonAPI ¶
func New ¶
Example ¶
subnet, err := netip.ParsePrefix("1.1.1.1/24") if err != nil { panic(err) } New(Config{ Type: dns.Type_doh, Name: "cloudflare", Host: "cloudflare-dns.com", Servername: "cloudflare-dns.com", IPv6: true, Subnet: subnet, })
Output:
func ParseAddr ¶
ParseAddr host eg: cloudflare-dns.com, https://cloudflare-dns.com, 1.1.1.1:853
Types ¶
type FakeDNS ¶
type FakeDNS struct { dns.DNS *FakeIPPool }
func NewFakeDNS ¶
type FakeIPPool ¶
type FakeIPPool struct {
// contains filtered or unexported fields
}
func NewFakeIPPool ¶
func NewFakeIPPool(prefix netip.Prefix, bbolt *cache.Cache) *FakeIPPool
func (*FakeIPPool) GetDomainFromIP ¶
func (n *FakeIPPool) GetDomainFromIP(ip netip.Addr) (string, bool)
func (*FakeIPPool) GetFakeIPForDomain ¶
func (n *FakeIPPool) GetFakeIPForDomain(s string) netip.Addr
Source Files ¶
Click to show internal directories.
Click to hide internal directories.