rule

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDir

func ListDir(dirPth string, suffix string) (files []string, err error)

ListDir returns file list named with suffix in dirPth

Types

type Config

type Config struct {
	Name string

	Forward        []string
	StrategyConfig strategy.Config

	DNSServers []string
	IPSet      string

	Domain []string
	IP     []string
	CIDR   []string
}

Config , every rule dialer points to a rule file

func NewConfFromFile

func NewConfFromFile(ruleFile string) (*Config, error)

NewConfFromFile .

type Proxy added in v0.9.3

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

Proxy struct

func NewProxy added in v0.9.3

func NewProxy(rules []*Config, proxy *strategy.Proxy) *Proxy

NewProxy returns a new rule proxy

func (*Proxy) AddDomainIP added in v0.9.3

func (p *Proxy) AddDomainIP(domain, ip string) error

AddDomainIP used to update ipMap rules according to domainMap rule

func (*Proxy) Check added in v0.9.3

func (p *Proxy) Check()

Check .

func (*Proxy) Dial added in v0.9.3

func (p *Proxy) Dial(network, addr string) (net.Conn, string, error)

Dial dials to targer addr and return a conn

func (*Proxy) DialUDP added in v0.9.3

func (p *Proxy) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error)

DialUDP connects to the given address via the proxy

func (*Proxy) NextDialer added in v0.9.3

func (p *Proxy) NextDialer(dstAddr string) proxy.Dialer

NextDialer return next dialer according to rule

Jump to

Keyboard shortcuts

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