discovery

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdgeSRVService = "v2-origintunneld"

	DotServerName = "cloudflare-dns.com"
	DotServerAddr = "1.1.1.1:853"
)

Variables

View Source
var (
	LookupEdgeSRVFn        = lookupEdgeSRV
	LookupEdgeSRVWithDoTFn = lookupEdgeSRVWithDoT
	EdgeLookupSRV          = net.LookupSRV
	EdgeLookupIP           = net.LookupIP
	EdgeDoTDestination     = M.ParseSocksaddr(DotServerAddr)
	EdgeDoTTLSClient       = func(conn net.Conn) net.Conn {
		return tls.Client(conn, &tls.Config{ServerName: DotServerName})
	}
)

Functions

func DiscoverEdge

func DiscoverEdge(ctx context.Context, region string, controlDialer N.Dialer) ([][]*EdgeAddr, error)

func FilterByIPVersion

func FilterByIPVersion(regions [][]*EdgeAddr, version int) [][]*EdgeAddr

func GetRegionalServiceName

func GetRegionalServiceName(region string) string

func ResolveSRVRecords

func ResolveSRVRecords(records []*net.SRV) ([][]*EdgeAddr, error)

Types

type EdgeAddr

type EdgeAddr struct {
	TCP       *net.TCPAddr
	UDP       *net.UDPAddr
	IPVersion int // 4 or 6
}

Jump to

Keyboard shortcuts

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