dnsproxy

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT 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

	// Mapper is the database which grants one to one mapping between domain and network address
	Mapper Mapper
	TTL    uint32
}

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.

type Mapper

type Mapper interface {
	EnsureMapping(clientKey, domainName string, ttl time.Duration) (netip.Addr, error)
}

Jump to

Keyboard shortcuts

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