router

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyDialFn added in v1.0.1

type ProxyDialFn func(network, host string, port uint16) (net.Conn, error)

type Router added in v1.0.1

type Router struct {
	BlockRule  *suffixtree.Node
	DirectRule *suffixtree.Node
	ProxyRule  *suffixtree.Node
	ProxyDial  ProxyDialFn
	// contains filtered or unexported fields
}

func NewRouter added in v1.0.1

func NewRouter(serveIP, fallbackDNS, mmdbFile string, proxyDial ProxyDialFn) *Router

func (*Router) AddCountryCIDRs added in v1.1.0

func (r *Router) AddCountryCIDRs(cidrs ...string)

func (*Router) DirectHandle added in v1.0.1

func (r *Router) DirectHandle(conn net.Conn, addr string) error

func (*Router) Exchange added in v1.1.2

func (r *Router) Exchange(req *dns.Msg) (_ *dns.Msg, err error)

func (*Router) ProxyHandle added in v1.0.1

func (r *Router) ProxyHandle(conn net.Conn, domain string, port uint16) error

func (*Router) RouteHandle added in v1.0.1

func (r *Router) RouteHandle(conn net.Conn, domain string, port uint16) (err error)

func (*Router) ServeDNS added in v1.0.1

func (r *Router) ServeDNS(w dns.ResponseWriter, req *dns.Msg)

Jump to

Keyboard shortcuts

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