dnsproxy

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dnsproxy is responsible for the DNS proxy server that will redirect specified domains to the SNI proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ListenAddr is the address the DNS server is supposed to listen to.
	ListenAddr netip.AddrPort

	// Upstream is the upstream that the requests will be forwarded to.  The
	// format of an upstream is the one that can be consumed by
	// [proxy.ParseUpstreamsConfig].
	Upstream string

	// RedirectIPv4To is the IP address A queries will be redirected to.
	RedirectIPv4To net.IP

	// RedirectIPv6To is the IP address AAAA queries will be redirected to.
	RedirectIPv6To net.IP

	// RedirectRules is a list of wildcards that is used for checking which
	// domains should be redirected.
	RedirectRules []string

	// DropRules is a list of wildcards that define DNS queries to which
	// domains will be dropped. "Dropped" means that the DNS server will not
	// respond to these queries.
	DropRules []string
}

Config is the DNS proxy configuration.

type DNSProxy

type DNSProxy struct {
	// contains filtered or unexported fields
}

DNSProxy is a struct that manages the DNS proxy server. This server's purpose is to redirect queries to a specified SNI proxy.

func New

func New(cfg *Config) (d *DNSProxy, err error)

New creates a new instance of *DNSProxy.

func (*DNSProxy) Close

func (d *DNSProxy) Close() (err error)

Close implements the io.Closer interface for DNSProxy.

func (*DNSProxy) Start

func (d *DNSProxy) Start() (err error)

Start starts the DNSProxy server.

Jump to

Keyboard shortcuts

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