picker

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Picker

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

func New

func New() *Picker

New returns a new fast thread safe random picker to use for DNS servers and their IP addresses.

func (*Picker) DoHServer

func (p *Picker) DoHServer(servers []provider.DoHServer) provider.DoHServer

func (*Picker) DoTAddrPort

func (p *Picker) DoTAddrPort(server provider.DoTServer, ipv6 bool) netip.AddrPort

DotAddrPort returns a randomly picked IP address and port from the given DoT server. If ipv6 is true, IPv6 addresses are added to the pool of IP addresses to pick from, on top of all IPv4 addresses. Note IPv4 addresses are always in the pool of addresses, because some providers only have IPv4 addresses, and IPv4 usually works on an IPv6 network, which is not true the other way around.

func (*Picker) DoTServer

func (p *Picker) DoTServer(servers []provider.DoTServer) provider.DoTServer

Jump to

Keyboard shortcuts

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