router

package
v0.3.1-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const FAKEDNS_MARK = "FAKEDNS"
View Source
const (
	MODE_MARK = "MODE"
)

Variables

View Source
var BYPASS_DATA []byte

Functions

This section is empty.

Types

type Mode

type Mode struct {
	Mode     protoconfig.BypassMode
	Default  bool
	Dialer   proxy.Proxy
	Resolver dns.DNS
	Rules    string
}

type Resolvers

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

func NewResolvers

func NewResolvers(direc, prox proxy.Proxy, counter statistics.Statistics) *Resolvers

func (*Resolvers) Close

func (r *Resolvers) Close() error

func (*Resolvers) Local

func (r *Resolvers) Local() idns.DNS

func (*Resolvers) Remote

func (r *Resolvers) Remote() idns.DNS

func (*Resolvers) Update

func (r *Resolvers) Update(s *protoconfig.Setting)

type Router

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

func NewRouter

func NewRouter(statistics stc.Statistics, bypassResolver dns.DNS, modes []Mode) *Router

func (Router) Conn

func (f Router) Conn(addr proxy.Address) (net.Conn, error)

func (Router) PacketConn

func (f Router) PacketConn(addr proxy.Address) (net.PacketConn, error)

func (Router) Resolver

func (f Router) Resolver(addr proxy.Address) idns.DNS

func (*Router) Update

func (a *Router) Update(s *protoconfig.Setting)

type Shunt

type Shunt interface {
	proxy.Proxy
	proxy.ResolverProxy
	config.Observer
	AddMode(mode string, isDefault bool, _ proxy.Proxy, _ dns.DNS)
	Insert(addr string, mode string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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