proxy

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: BSD-3-Clause Imports: 32 Imported by: 34

Documentation

Index

Constants

View Source
const (
	BlockedByGFWRule = "BlockedByGFW"
	InHostsRule      = "InHosts"
	IsCNIPRule       = "IsCNIP"
)
View Source
const (
	SO_ORIGINAL_DST      = 80
	IP6T_SO_ORIGINAL_DST = 80
	IPV6_RECVORIGDSTADDR = 74
)

Variables

This section is empty.

Functions

func MatchPatterns added in v0.26.1

func MatchPatterns(str string, rules []string) bool

func Start

func Start(options ProxyOptions) error

func StartProxy added in v0.29.0

func StartProxy() error

func Stop

func Stop() error

func SyncConfig

func SyncConfig(addr string, localDir string) (bool, error)

Types

type AdminConfig

type AdminConfig struct {
	Listen        string
	BroadcastAddr string
	ConfigDir     string
}

type GFWListConfig added in v0.26.0

type GFWListConfig struct {
	URL                   string
	UserRule              []string
	Proxy                 string
	RefershPeriodMiniutes int
}

type LocalConfig

type LocalConfig struct {
	Log             []string
	Cipher          channel.CipherConfig
	Mux             channel.MuxConfig
	UserAgent       string
	User            string
	LocalDNS        dns.LocalDNSConfig
	UDPGW           UDPGWConfig
	SNI             SNIConfig
	Admin           AdminConfig
	GFWList         GFWListConfig
	TransparentMark int
	Proxy           []ProxyConfig
	Channel         []channel.ProxyChannelConfig
}
var GConf LocalConfig

type PACConfig

type PACConfig struct {
	Method   []string
	Host     []string
	URL      []string
	Rule     []string
	Protocol []string
	Remote   string
}

func (*PACConfig) Match

func (pac *PACConfig) Match(protocol string, ip string, req *http.Request) bool

type ProxyConfig

type ProxyConfig struct {
	Local string
	//DNSReadMSTimeout int
	//UDPReadMSTimeout int
	PAC []PACConfig
}

type ProxyOptions added in v0.28.0

type ProxyOptions struct {
	Config    string
	Hosts     string
	CNIP      string
	Home      string
	WatchConf bool
}

type SNIConfig added in v0.27.2

type SNIConfig struct {
	Redirect map[string]string
}

type UDPGWConfig added in v0.27.2

type UDPGWConfig struct {
	Addr string
}

Jump to

Keyboard shortcuts

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