dns_proxy

package
v2.0.0-...-986824d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: GPL-3.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSEDNS0

func NewJSEDNS0(e dns.EDNS0) (jsEDNS0 map[string]interface{}, err error)

func NewJSResourceRecord

func NewJSResourceRecord(rr dns.RR) (jsRecord map[string]interface{}, err error)

func NewJSSVCBKeyValue

func NewJSSVCBKeyValue(kv dns.SVCBKeyValue) (map[string]interface{}, error)

func ToEDNS0

func ToEDNS0(jsEDNS0 map[string]interface{}) (e dns.EDNS0, err error)

func ToRR

func ToRR(jsRecord map[string]interface{}) (rr dns.RR, err error)

func ToSVCBKeyValue

func ToSVCBKeyValue(jsKv map[string]interface{}) (dns.SVCBKeyValue, error)

Types

type DNSProxy

type DNSProxy struct {
	Name        string
	Address     string
	Server      *dns.Server
	Redirection *firewall.Redirection
	Nameserver  string
	NetProtocol string
	Script      *DnsProxyScript
	CertFile    string
	KeyFile     string
	Blacklist   []string
	Whitelist   []string
	Sess        *session.Session
	// contains filtered or unexported fields
}

func NewDNSProxy

func NewDNSProxy(s *session.Session, tag string) *DNSProxy

func (*DNSProxy) Configure

func (p *DNSProxy) Configure(address string, dnsPort int, doRedirect bool, nameserver string, netProtocol string, proxyPort int, scriptPath string, certFile string, keyFile string) error

func (*DNSProxy) Debug

func (p *DNSProxy) Debug(format string, args ...interface{})

func (*DNSProxy) Error

func (p *DNSProxy) Error(format string, args ...interface{})

func (*DNSProxy) Fatal

func (p *DNSProxy) Fatal(format string, args ...interface{})

func (*DNSProxy) Info

func (p *DNSProxy) Info(format string, args ...interface{})

func (*DNSProxy) Start

func (p *DNSProxy) Start()

func (*DNSProxy) Stop

func (p *DNSProxy) Stop() error

func (*DNSProxy) Warning

func (p *DNSProxy) Warning(format string, args ...interface{})

type DnsProxy

type DnsProxy struct {
	session.SessionModule
	// contains filtered or unexported fields
}

func NewDnsProxy

func NewDnsProxy(s *session.Session) *DnsProxy

func (*DnsProxy) Author

func (mod *DnsProxy) Author() string

func (*DnsProxy) Configure

func (mod *DnsProxy) Configure() error

func (*DnsProxy) Description

func (mod *DnsProxy) Description() string

func (*DnsProxy) Name

func (mod *DnsProxy) Name() string

func (*DnsProxy) Start

func (mod *DnsProxy) Start() error

func (*DnsProxy) Stop

func (mod *DnsProxy) Stop() error

type DnsProxyScript

type DnsProxyScript struct {
	*plugin.Plugin
	// contains filtered or unexported fields
}

func LoadDnsProxyScript

func LoadDnsProxyScript(path string, sess *session.Session) (err error, s *DnsProxyScript)

func (*DnsProxyScript) OnCommand

func (s *DnsProxyScript) OnCommand(cmd string) bool

func (*DnsProxyScript) OnRequest

func (s *DnsProxyScript) OnRequest(req *dns.Msg, clientIP string) (jsreq, jsres *JSQuery)

func (*DnsProxyScript) OnResponse

func (s *DnsProxyScript) OnResponse(req, res *dns.Msg, clientIP string) (jsreq, jsres *JSQuery)

type JSQuery

type JSQuery struct {
	Answers     []map[string]interface{}
	Client      map[string]string
	Compress    bool
	Extras      []map[string]interface{}
	Header      JSQueryHeader
	Nameservers []map[string]interface{}
	Questions   []map[string]interface{}
	// contains filtered or unexported fields
}

func NewJSQuery

func NewJSQuery(query *dns.Msg, clientIP string) (jsQuery *JSQuery)

func (*JSQuery) CheckIfModifiedAndUpdateHash

func (j *JSQuery) CheckIfModifiedAndUpdateHash() bool

func (*JSQuery) NewHash

func (j *JSQuery) NewHash() string

func (*JSQuery) ToQuery

func (j *JSQuery) ToQuery() *dns.Msg

func (*JSQuery) UpdateHash

func (j *JSQuery) UpdateHash()

func (*JSQuery) WasModified

func (j *JSQuery) WasModified() bool

type JSQueryHeader

type JSQueryHeader struct {
	AuthenticatedData  bool
	Authoritative      bool
	CheckingDisabled   bool
	Id                 uint16
	Opcode             int
	Rcode              int
	RecursionAvailable bool
	RecursionDesired   bool
	Response           bool
	Truncated          bool
	Zero               bool
}

Jump to

Keyboard shortcuts

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