local

package
v0.0.0-...-3fdcba8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: BSD-3-Clause Imports: 35 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func MatchPatterns

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

func Start

func Start(options ProxyOptions) error

func StartProxy

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

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

type HTTPDumpConfig

type HTTPDumpConfig struct {
	Dump        string
	Domain      []string
	ExcludeBody []string
	IncludeBody []string
}

func (*HTTPDumpConfig) MatchDomain

func (dump *HTTPDumpConfig) MatchDomain(host string) bool

type LocalConfig

type LocalConfig struct {
	Log             []string
	Cipher          channel.CipherConfig
	Mux             channel.MuxConfig
	ProxyLimit      channel.ProxyLimitConfig
	UserAgent       string
	UPNPExposePort  int
	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
	Forward     string
	MITM        bool //Man-in-the-middle
	Transparent bool
	HTTPDump    HTTPDumpConfig
	PAC         []PACConfig
}

type ProxyOptions

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

type SNIConfig

type SNIConfig struct {
	Redirect map[string]string
}

type UDPGWConfig

type UDPGWConfig struct {
	Addr string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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