proxy

package
v0.0.0-...-a0262a8 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfiguration

type CacheConfiguration struct {
	MaxSize              int `json:"maxSize"`
	MaxPurgesPerTimerPop int `json:"maxPurgesPerTimerPop"`
	TimerIntervalSeconds int `json:"timerIntervalSeconds"`
}

CacheConfiguration is the cache configuration.

type Configuration

type Configuration struct {
	MetricsConfiguration   MetricsConfiguration   `json:"metricsConfiguration"`
	DNSServerConfiguration DNSServerConfiguration `json:"dnsServerConfiguration"`
	DOHClientConfiguration DOHClientConfiguration `json:"dohClientConfiguration"`
	DNSProxyConfiguration  DNSProxyConfiguration  `json:"dnsProxyConfiguration"`
	CacheConfiguration     CacheConfiguration     `json:"cacheConfiguration"`
	PrefetchConfiguration  PrefetchConfiguration  `json:"PrefetchConfiguration"`
	PprofConfiguration     PprofConfiguration     `json:"pprofConfiguration"`
}

Configuration is the DNS proxy configuration.

func ReadConfiguration

func ReadConfiguration(configFile string) (*Configuration, error)

ReadConfiguration reads the DNS proxy configuration from a json file.

type DNSProxy

type DNSProxy interface {
	Start()
}

DNSProxy is the DNS proxy.

func NewDNSProxy

func NewDNSProxy(configuration *Configuration) DNSProxy

NewDNSProxy creates a DNS proxy.

type DNSProxyConfiguration

type DNSProxyConfiguration struct {
	ForwardDomainConfigurations []ForwardDomainConfiguration `json:"forwardDomainConfigurations"`
	ReverseDomainConfigurations []ReverseDomainConfiguration `json:"reverseDomainConfigurations"`
	BlockedDomainsFile          string                       `json:"blockedDomainsFile"`
	ClampMinTTLSeconds          uint32                       `json:"clampMinTTLSeconds"`
	ClampMaxTTLSeconds          uint32                       `json:"clampMaxTTLSeconds"`
}

DNSProxyConfiguration is the proxy configuration.

type DNSServerConfiguration

type DNSServerConfiguration struct {
	ListenAddress HostAndPort `json:"listenAddress"`
}

DNSServerConfiguration is the DNS server configuration.

type DOHClientConfiguration

type DOHClientConfiguration struct {
	URL                                 string `json:"url"`
	MaxConcurrentRequests               int64  `json:"maxConcurrentRequests"`
	SemaphoreAcquireTimeoutMilliseconds int    `json:"semaphoreAcquireTimeoutMilliseconds"`
	RequestTimeoutMilliseconds          int    `json:"requestTimeoutMilliseconds"`
}

DOHClientConfiguration is the DOH client configuration

type ForwardDomainConfiguration

type ForwardDomainConfiguration struct {
	Domain             string                 `json:"domain"`
	NamesToAddresses   []ForwardNameToAddress `json:"namesToAddresses"`
	ResponseTTLSeconds uint32                 `json:"responseTTLSeconds"`
}

ForwardDomainConfiguration is the configuration for a forward domain.

type ForwardNameToAddress

type ForwardNameToAddress struct {
	Name      string `json:"name"`
	IPAddress string `json:"ipAddress"`
}

ForwardNameToAddress is a forward name to IP address mapping.

type HostAndPort

type HostAndPort struct {
	Host string `json:"host"`
	Port string `json:"port"`
}

HostAndPort is a host and port.

type MetricsConfiguration

type MetricsConfiguration struct {
	TimerIntervalSeconds int `json:"timerIntervalSeconds"`
}

MetricsConfiguration is the metrics configuration.

type PprofConfiguration

type PprofConfiguration struct {
	Enabled       bool   `json:"enabled"`
	ListenAddress string `json:"listenAddress"`
}

PprofConfiguration is the pprof configuration.

type PrefetchConfiguration

type PrefetchConfiguration struct {
	MaxCacheSize            int `json:"maxCacheSize"`
	NumWorkers              int `json:"numWorkers"`
	SleepIntervalSeconds    int `json:"sleepIntervalSeconds"`
	MaxCacheEntryAgeSeconds int `json:"maxCacheEntryAgeSeconds"`
}

PrefetchConfiguration is the prefetch configuration.

type ReverseAddressToName

type ReverseAddressToName struct {
	ReverseAddress string `json:"reverseAddress"`
	Name           string `json:"name"`
}

ReverseAddressToName is a reverse address to name mapping.

type ReverseDomainConfiguration

type ReverseDomainConfiguration struct {
	Domain             string                 `json:"domain"`
	AddressesToNames   []ReverseAddressToName `json:"addressesToNames"`
	ResponseTTLSeconds uint32                 `json:"responseTTLSeconds"`
}

ReverseDomainConfiguration is the configuration for a reverse domain.

Jump to

Keyboard shortcuts

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