Documentation
¶
Index ¶
- Constants
- Variables
- func DnsGetDoaminIP(domain string) (string, error)
- func HandleEvent(ev event.Event) error
- func MatchPatterns(str string, rules []string) bool
- func NewAuthEvent(secureTransport bool) *event.AuthEvent
- func NewHTTPClient(conf *ProxyChannelConfig) (*http.Client, error)
- func RegisterProxyType(str string, p Proxy) error
- func Start(home string, monitor InternalEventMonitor) error
- func Stop() error
- func SyncConfig(addr string, localDir string) error
- type AdminConfig
- type EncryptConfig
- type Feature
- type GFWListConfig
- type IPRange
- type IPRangeHolder
- type InternalEventMonitor
- type LocalConfig
- type LocalDNSConfig
- type PACConfig
- type Proxy
- type ProxyChannel
- type ProxyChannelConfig
- type ProxyConfig
- type ProxySession
- type RangeFetcher
- type RemoteChannel
- func (rc *RemoteChannel) Close()
- func (rc *RemoteChannel) GetActiveSessionNum() int32
- func (rc *RemoteChannel) Init(authRequired bool) error
- func (rc *RemoteChannel) Request(ev event.Event) (event.Event, error)
- func (rc *RemoteChannel) Stop()
- func (rc *RemoteChannel) Write(ev event.Event) error
- func (rc *RemoteChannel) WriteRaw(p []byte) (int, error)
- type RemoteChannelTable
- type RemoteProxyChannel
Constants ¶
View Source
const ( BlockedByGFWRule = "BlockedByGFW" InHostsRule = "InHosts" IsCNIPRule = "IsCNIP" )
Variables ¶
View Source
var ErrChannelAuthFailed = errors.New("Remote channel auth failed")
View Source
var ErrChannelReadTimeout = errors.New("Remote channel read timeout")
Functions ¶
func DnsGetDoaminIP ¶ added in v0.26.2
func HandleEvent ¶
func MatchPatterns ¶ added in v0.26.1
func NewAuthEvent ¶
func NewHTTPClient ¶ added in v0.26.3
func NewHTTPClient(conf *ProxyChannelConfig) (*http.Client, error)
func RegisterProxyType ¶ added in v0.24.1
func Start ¶
func Start(home string, monitor InternalEventMonitor) error
func SyncConfig ¶ added in v0.24.0
Types ¶
type AdminConfig ¶ added in v0.24.0
type EncryptConfig ¶
type GFWListConfig ¶ added in v0.26.0
type IPRangeHolder ¶
type IPRangeHolder struct {
// contains filtered or unexported fields
}
func (*IPRangeHolder) Clear ¶ added in v0.24.0
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 LocalConfig ¶
type LocalConfig struct {
Log []string
Encrypt EncryptConfig
UserAgent string
Auth string
LocalDNS LocalDNSConfig
UDPGWAddr string
ChannelKeepAlive bool
Admin AdminConfig
GFWList GFWListConfig
Proxy []ProxyConfig
Channel []ProxyChannelConfig
}
var GConf LocalConfig
type LocalDNSConfig ¶
type PACConfig ¶
type Proxy ¶
type Proxy interface {
Init(conf ProxyChannelConfig) error
//Type() string
Config() *ProxyChannelConfig
Destory() error
Features() Feature
PrintStat(w io.Writer)
Serve(session *ProxySession, ev event.Event) error
}
type ProxyChannelConfig ¶ added in v0.24.1
type ProxyChannelConfig struct {
Enable bool
Name string
Type string
ServerList []string
ConnsPerServer int
SNI []string
SNIProxy string
Proxy string
DialTimeout int
ReadTimeout int
ReconnectPeriod int
HeartBeatPeriod int
RCPRandomAdjustment int
HTTPChunkPushEnable bool
ForceTLS bool
// contains filtered or unexported fields
}
func (*ProxyChannelConfig) IsDirect ¶ added in v0.24.1
func (c *ProxyChannelConfig) IsDirect() bool
func (*ProxyChannelConfig) ProxyURL ¶ added in v0.26.0
func (c *ProxyChannelConfig) ProxyURL() *url.URL
type ProxyConfig ¶
type ProxySession ¶
type ProxySession struct {
Remote *RemoteChannel
Hijacked bool
SSLHijacked bool
// contains filtered or unexported fields
}
func (*ProxySession) Close ¶
func (s *ProxySession) Close() error
func (*ProxySession) SetRemoteChannel ¶ added in v0.24.0
func (s *ProxySession) SetRemoteChannel(r *RemoteChannel)
type RangeFetcher ¶
type RangeFetcher struct {
SingleFetchLimit int64
ConcurrentFetcher int32
C *RemoteChannel
}
func (*RangeFetcher) Fetch ¶
func (f *RangeFetcher) Fetch(req *event.HTTPRequestEvent) (*event.HTTPResponseEvent, error)
type RemoteChannel ¶
type RemoteChannel struct {
Addr string
Index int
DirectIO bool
WriteJoinAuth bool
OpenJoinAuth bool
SecureTransport bool
HeartBeatPeriod int
ReconnectPeriod int
RCPRandomAdjustment int
C RemoteProxyChannel
// contains filtered or unexported fields
}
func (*RemoteChannel) Close ¶
func (rc *RemoteChannel) Close()
func (*RemoteChannel) GetActiveSessionNum ¶ added in v0.24.0
func (rc *RemoteChannel) GetActiveSessionNum() int32
func (*RemoteChannel) Init ¶
func (rc *RemoteChannel) Init(authRequired bool) error
func (*RemoteChannel) Stop ¶
func (rc *RemoteChannel) Stop()
type RemoteChannelTable ¶
type RemoteChannelTable struct {
// contains filtered or unexported fields
}
func NewRemoteChannelTable ¶
func NewRemoteChannelTable() *RemoteChannelTable
func (*RemoteChannelTable) Add ¶
func (p *RemoteChannelTable) Add(c *RemoteChannel)
func (*RemoteChannelTable) PrintStat ¶ added in v0.24.0
func (p *RemoteChannelTable) PrintStat(w io.Writer)
func (*RemoteChannelTable) Select ¶
func (p *RemoteChannelTable) Select() *RemoteChannel
func (*RemoteChannelTable) StopAll ¶
func (p *RemoteChannelTable) StopAll()
type RemoteProxyChannel ¶
Click to show internal directories.
Click to hide internal directories.