dnscrypt

package
v0.0.0-...-dd04f72 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NonceSize is what the name suggests
	NonceSize = 24
	// TagSize is what the name suggests
	TagSize = 16
	// HalfNonceSize is half of NonceSize
	HalfNonceSize = NonceSize / 2
	// PublicKeySize is the size of a public key
	PublicKeySize = 32
	// QueryOverhead is the amount of request overhead due to client-magic, public key, nonce, and tag
	QueryOverhead = xdns.ClientMagicLen + PublicKeySize + HalfNonceSize + TagSize
	// ResponseOverhead is the amount of answer overhead due to server-magic, nonce, and tag
	ResponseOverhead = len(xdns.ServerMagic) + NonceSize + TagSize
)
View Source
const (
	ActionNone     = iota // No action has been taken
	ActionContinue        // Continue with the request
	ActionDrop            // Drop the request
	ActionSynth           // Use synthesized response
)
View Source
const (
	ReturnCodePass = iota
	ReturnCodeSynth
)

Variables

This section is empty.

Functions

func AddRelayTransport

func AddRelayTransport(p *DcMulti, relaystamp string) error

AddRelayTransport creates and adds a relay server to p

func AddTransport

func AddTransport(p *DcMulti, id, serverstamp string) (dnsx.Transport, error)

AddTransport creates and adds a dnscrypt transport to p

Types

type DcMulti

type DcMulti struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DcMulti is a dnsx.TransportMult supporting dnscrypt servers and relays

func NewDcMult

func NewDcMult(px ipn.Proxies, ctl protect.Controller) *DcMulti

NewDcMult creates a dnscrypt proxy

func (*DcMulti) Add

func (proxy *DcMulti) Add(t x.DNSTransport) bool

Add implements dnsx.TransportMult

func (*DcMulti) AddAll

func (proxy *DcMulti) AddAll(serverscsv string) (int, error)

AddAll registers additional dnscrypt servers

func (*DcMulti) AddGateways

func (proxy *DcMulti) AddGateways(routescsv string) (int, error)

AddGateways adds relay servers

func (*DcMulti) Get

func (proxy *DcMulti) Get(id string) (x.DNSTransport, error)

Get implements dnsx.TransportMult

func (*DcMulti) GetAddr

func (p *DcMulti) GetAddr() string

GetAddr returns the last server address

func (*DcMulti) ID

func (p *DcMulti) ID() string

ID implements dnsx.TransportMult

func (*DcMulti) LiveTransports

func (proxy *DcMulti) LiveTransports() string

LiveTransports returns csv of dnscrypt server-names currently in-use

func (*DcMulti) P50

func (p *DcMulti) P50() int64

P50 implements dnsx.TransportMult

func (*DcMulti) Query

func (p *DcMulti) Query(network string, q []byte, summary *x.DNSSummary) (r []byte, err error)

Query implements dnsx.TransportMult

func (*DcMulti) Refresh

func (proxy *DcMulti) Refresh() (string, error)

Refresh re-registers servers

func (*DcMulti) Remove

func (proxy *DcMulti) Remove(uid string) bool

Remove removes a dnscrypt server / relay, if any

func (*DcMulti) RemoveAll

func (proxy *DcMulti) RemoveAll(servernamescsv string) (int, error)

RemoveAll removes all dnscrypt servers in the csv

func (*DcMulti) RemoveGateways

func (proxy *DcMulti) RemoveGateways(routescsv string) (int, error)

RemoveGateways removes relay servers

func (*DcMulti) Status

func (p *DcMulti) Status() int

Status implements dnsx.TransportMult

func (*DcMulti) Stop

func (proxy *DcMulti) Stop() error

Stop stops this dnscrypt proxy

func (*DcMulti) Type

func (p *DcMulti) Type() string

Type implements dnsx.TransportMult

type ServersInfo

type ServersInfo struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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