nodes

package
v1.2.18 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Windows  = 7
	DoH      = "DoH"
	DoT      = "DoT"
	DNSCrypt = "DNSCrypt"
)
View Source
const (
	Well_Known_Tag_NO_PROXY                 = "NO-PROXY" // intranet
	Well_Known_Tag_HTTP_USE_GET             = "HTTP-USE-GET"
	Well_Known_Tag_DNS_BOOST_GROUP          = "DNS-BOOST-GROUP"          // shared across all servers
	Well_Known_Tag_DNSSEC_PRIME_GROUP       = "DNSSEC-PRIME-GROUP"       // shared across all servers
	Well_Known_Tag_DNSCRPT_OBTAIN_FAST_KEY  = "DNSCRPT-OBTAIN-FAST-KEY"  // works with cfg:credentialpath when import_credential=false
	Well_Known_Tag_DNSCRPT_EARLY_REGULATION = "DNSCRPT-EARLY-REGULATION" // catch up 'key rotation' and use 1o2 random server PK
	Well_Known_Tag_TIMEOUT1                 = "TIMEOUT1"                 //1s
	Well_Known_Tag_TIMEOUT2                 = "TIMEOUT2"                 //2s
	Well_Known_Tag_TIMEOUT3                 = "TIMEOUT3"                 //3s
	Well_Known_Tag_PQENABLED                = "PQ"                       //tls+kyber768
	Well_Known_Tag_PQFORCED                 = "FPQ"                      //tls kyber768 only
)

Predefined Well-known Tag Name

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymizedDNSConfig

type AnonymizedDNSConfig struct {
	Routes []AnonymizedDNSRouteConfig `toml:"routes"`
}

type AnonymizedDNSRouteConfig

type AnonymizedDNSRouteConfig struct {
	ServerName string   `toml:"server_name"`
	RelayNames []string `toml:"via"`
}

type Config

type Config struct {
	ServerNames              []string `toml:"enabled_server_names"`        // temporary filter of names
	DisabledServerNames      []string `toml:"disabled_server_names"`       // temporary filter of names
	DnscryptTCP              bool     `toml:"dnscrypt_use_tcp"`            // parameter for dnscrypt protocol
	Bootstrap                bool     `toml:"bootstrap"`                   // allow bootstrap; no ip address
	TLSDisableSessionTickets bool     `toml:"tls_disable_session_tickets"` // parameter for (doh/dot)tls protocol
	Timeout                  int      `toml:"timeout"`                     // parameter for communication protocol
	KeepAlive                int      `toml:"keepalive"`                   // parameter for communication protocol
	MaxUpstreams             uint32   `toml:"max_concurrent_upstreams"`    // simultaneous outgoing dns query directly by downstreams
	ExportCredentialPath     string   `toml:"credentialpath"`              // export persistence credential file
	ImportCredential         bool     `toml:"import_credential"`           // load persistence credential file when startup and skip seeking public key(dnscrypt) if valid till now
	FetchInterval            int      `toml:"interval"`                    // to fetch public key of dnscrypt or determine connectivity to the upstreams; 0>=no_interval
	DefaultUnavailable       bool     `toml:"default_unavailable"`         // mark all nodes unavailable on startup then determine connectivity for each
	FetchAtLeastTwo          bool     `toml:"at_least_one_or_two"`         // keep fetching without interval until one(n=1) or two(n>1) nodes are available
	NoMetrics                bool     `toml:"no_metrics"`                  // lock free; useful at low hardware conditions
}

type ListenerConfiguration

type ListenerConfiguration struct {
	Regex      *services.Regexp_builder
	Groups     *map[string]*Servers
	ServerList *Servers
	DNSSEC     bool
}

type NodesMgr

type NodesMgr struct {
	*conceptions.SemaGroup

	metrics.RTT

	L2NMapping *[]*ListenerConfiguration          // mapping between listeners and nodes
	Tags       *map[string]map[string]interface{} //key:tag values:servers
	SP         func(*channels.Session)
	SPNoIPv6   *bool
	Ready      chan interface{}
	// contains filtered or unexported fields
}

A simple node manager across all servers

func (*NodesMgr) Init

func (mgr *NodesMgr) Init(cfg *Config, routes *AnonymizedDNSConfig, sum []byte, servers, relays, proxies map[string]*common.RegisteredServer, globalproxy *conceptions.NestedProxy, ifi *string)

func (*NodesMgr) Query

func (mgr *NodesMgr) Query(s *channels.Session) error

type Servers

type Servers struct {
	Priority bool
	DNSSEC   bool
	Servers  []*string
}

type SourceConfig

type SourceConfig struct {
	URL            string   //faker for fun
	URLs           []string //faker for fun
	Prefix         string   //of names
	MinisignKeyStr string   `toml:"minisign_key"`
	CacheFile      string   `toml:"cache_file"`
	FormatStr      string   `toml:"format"`        //dummy of creation
	RefreshDelay   int      `toml:"refresh_delay"` //faker for fun
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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