proxy

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockedByGFWRule = "BlockedByGFW"
	InHostsRule      = "InHosts"
	IsCNIPRule       = "IsCNIP"
)

Variables

This section is empty.

Functions

func DnsGetDoaminIP added in v0.26.2

func DnsGetDoaminIP(domain string) (string, error)

func InitialPMuxConfig added in v0.27.0

func InitialPMuxConfig(conf *ProxyChannelConfig) *pmux.Config

func MatchPatterns added in v0.26.1

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

func NewDialByConf added in v0.27.0

func NewDialByConf(conf *ProxyChannelConfig) func(network, addr string) (net.Conn, error)

func NewHTTPClient added in v0.26.3

func NewHTTPClient(conf *ProxyChannelConfig) (*http.Client, error)

func RegisterProxyType added in v0.24.1

func RegisterProxyType(str string, p Proxy) error

func Start

func Start(home string, monitor InternalEventMonitor) 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 CipherConfig added in v0.27.0

type CipherConfig struct {
	Method string
	Key    string
}

type GFWListConfig added in v0.26.0

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

type HTTPBaseConfig added in v0.27.0

type HTTPBaseConfig struct {
	HTTPPushRateLimitPerSec int
}

type HTTPConfig added in v0.27.0

type HTTPConfig struct {
	HTTPBaseConfig
}

func (*HTTPConfig) UnmarshalJSON added in v0.27.0

func (hcfg *HTTPConfig) UnmarshalJSON(data []byte) error

type IPRange

type IPRange struct {
	Start, End uint64
	Country    string
}

type IPRangeHolder

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

func (*IPRangeHolder) Clear

func (h *IPRangeHolder) Clear()

func (*IPRangeHolder) FindCountry

func (h *IPRangeHolder) FindCountry(ip string) (string, error)

func (*IPRangeHolder) Len

func (h *IPRangeHolder) Len() int

func (*IPRangeHolder) Less

func (h *IPRangeHolder) Less(i, j int) bool

Less returns whether the element with index i should sort before the element with index j.

func (*IPRangeHolder) Swap

func (h *IPRangeHolder) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type InternalEventMonitor added in v0.24.1

type InternalEventMonitor func(code int, desc string) error

type KCPBaseConfig added in v0.27.0

type KCPBaseConfig struct {
	Mode         string
	Conn         int
	AutoExpire   int
	ScavengeTTL  int
	MTU          int
	SndWnd       int
	RcvWnd       int
	DataShard    int
	ParityShard  int
	DSCP         int
	AckNodelay   bool
	NoDelay      int
	Interval     int
	Resend       int
	NoCongestion int
	SockBuf      int
}

type KCPConfig added in v0.27.0

type KCPConfig struct {
	KCPBaseConfig
}

func (*KCPConfig) UnmarshalJSON added in v0.27.0

func (kcfg *KCPConfig) UnmarshalJSON(data []byte) error

type LocalConfig

type LocalConfig struct {
	Log              []string
	Cipher           CipherConfig
	UserAgent        string
	User             string
	LocalDNS         LocalDNSConfig
	UDPGWAddr        string
	ChannelKeepAlive bool
	Admin            AdminConfig
	GFWList          GFWListConfig
	Proxy            []ProxyConfig
	Channel          []ProxyChannelConfig
}
var GConf LocalConfig

type LocalDNSConfig

type LocalDNSConfig struct {
	Listen     string
	TrustedDNS []string
	FastDNS    []string
	TCPConnect bool
	CacheSize  int
}

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 Proxy

type Proxy interface {
	//PrintStat(w io.Writer)
	CreateMuxSession(server string, conf *ProxyChannelConfig) (mux.MuxSession, error)
	Features() ProxyFeatureSet
}

type ProxyChannelConfig added in v0.24.1

type ProxyChannelConfig struct {
	Enable              bool
	Name                string
	ServerList          []string
	ConnsPerServer      int
	SNI                 []string
	SNIProxy            string
	Proxy               string
	DialTimeout         int
	ReadTimeout         int
	ReconnectPeriod     int
	HeartBeatPeriod     int
	RCPRandomAdjustment int
	Compressor          string
	KCP                 KCPConfig
	HTTP                HTTPConfig
	// contains filtered or unexported fields
}

func (*ProxyChannelConfig) ProxyURL added in v0.26.0

func (c *ProxyChannelConfig) ProxyURL() *url.URL

type ProxyConfig

type ProxyConfig struct {
	Local    string
	PAC      []PACConfig
	SNISniff bool
}

type ProxyFeatureSet added in v0.27.0

type ProxyFeatureSet struct {
	AutoExpire bool
}

Jump to

Keyboard shortcuts

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