Documentation ¶
Index ¶
- Constants
- Variables
- func AllowedSchema() []string
- func DialServerByConf(server string, conf *ProxyChannelConfig) (net.Conn, error)
- func DumpLoaclChannelStat(w io.Writer)
- func InitialPMuxConfig(cipher *CipherConfig) *pmux.Config
- func IsDirectScheme(scheme string) bool
- func NewDialByConf(conf *ProxyChannelConfig, scheme string) func(network, addr string) (net.Conn, error)
- func NewHTTPClient(conf *ProxyChannelConfig, scheme string) (*http.Client, error)
- func NewTLSConfig(conf *ProxyChannelConfig) *tls.Config
- func RegisterLocalChannelType(str string, p LocalChannel) error
- func ServProxyMuxSession(session mux.MuxSession, auth *mux.AuthRequest, raddr net.Addr) error
- func SetDefaultMuxConfig(cfg MuxConfig)
- func SetDefaultProxyLimitConfig(cfg ProxyLimitConfig)
- func StopLocalChannels()
- type CipherConfig
- type DeadLineAccetor
- type FeatureSet
- type HTTPBaseConfig
- type HTTPConfig
- type HopServers
- type KCPBaseConfig
- type KCPConfig
- type LocalChannel
- type LocalProxyChannel
- type MuxConfig
- type ProxyChannelConfig
- type ProxyLimitConfig
- type RateLimitConfig
Constants ¶
View Source
const DirectChannelName = "direct"
View Source
const Version = "0.34.0"
Variables ¶
View Source
var DirectSchemes = []string{ DirectChannelName, "socks", "socks4", "socks5", "http_proxy", }
View Source
var ErrNotSupportedOperation = errors.New("Not supported operation")
View Source
var UPNPExposePort int
Functions ¶
func AllowedSchema ¶
func AllowedSchema() []string
func DialServerByConf ¶
func DialServerByConf(server string, conf *ProxyChannelConfig) (net.Conn, error)
func DumpLoaclChannelStat ¶
func InitialPMuxConfig ¶
func InitialPMuxConfig(cipher *CipherConfig) *pmux.Config
func IsDirectScheme ¶
func NewDialByConf ¶
func NewHTTPClient ¶
func NewHTTPClient(conf *ProxyChannelConfig, scheme string) (*http.Client, error)
func NewTLSConfig ¶
func NewTLSConfig(conf *ProxyChannelConfig) *tls.Config
func RegisterLocalChannelType ¶
func RegisterLocalChannelType(str string, p LocalChannel) error
func ServProxyMuxSession ¶
func ServProxyMuxSession(session mux.MuxSession, auth *mux.AuthRequest, raddr net.Addr) error
func SetDefaultMuxConfig ¶
func SetDefaultMuxConfig(cfg MuxConfig)
func SetDefaultProxyLimitConfig ¶
func SetDefaultProxyLimitConfig(cfg ProxyLimitConfig)
func StopLocalChannels ¶
func StopLocalChannels()
Types ¶
type CipherConfig ¶
type CipherConfig struct { User string Method string Key string // contains filtered or unexported fields }
var DefaultServerCipher CipherConfig
func (*CipherConfig) Adjust ¶
func (conf *CipherConfig) Adjust()
func (*CipherConfig) AllowUsers ¶
func (conf *CipherConfig) AllowUsers(users string)
func (*CipherConfig) VerifyUser ¶
func (conf *CipherConfig) VerifyUser(user string) bool
type DeadLineAccetor ¶
type FeatureSet ¶
type HTTPBaseConfig ¶
type HTTPConfig ¶
type HTTPConfig struct {
HTTPBaseConfig
}
func (*HTTPConfig) UnmarshalJSON ¶
func (hcfg *HTTPConfig) UnmarshalJSON(data []byte) error
type HopServers ¶
type HopServers []string
func (*HopServers) Set ¶
func (i *HopServers) Set(value string) error
func (*HopServers) String ¶
func (i *HopServers) String() string
type KCPBaseConfig ¶
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 }
func (*KCPBaseConfig) InitDefaultConf ¶
func (kcfg *KCPBaseConfig) InitDefaultConf()
type LocalChannel ¶
type LocalChannel interface { //PrintStat(w io.Writer) CreateMuxSession(server string, conf *ProxyChannelConfig) (mux.MuxSession, error) Features() FeatureSet }
type LocalProxyChannel ¶
type LocalProxyChannel struct { Conf ProxyChannelConfig // contains filtered or unexported fields }
func NewProxyChannel ¶
func NewProxyChannel(conf *ProxyChannelConfig) *LocalProxyChannel
func (*LocalProxyChannel) Init ¶
func (ch *LocalProxyChannel) Init(lock bool) bool
type MuxConfig ¶
type MuxConfig struct { MaxStreamWindow string StreamMinRefresh string StreamIdleTimeout int SessionIdleTimeout int UpBufferSize int DownBufferSize int }
func (*MuxConfig) ToPMuxConf ¶
type ProxyChannelConfig ¶
type ProxyChannelConfig struct { Enable bool Name string ServerList []string ConnsPerServer int SNI []string SNIProxy string Proxy string RemoteDialMSTimeout int RemoteDNSReadMSTimeout int RemoteUDPReadMSTimeout int LocalDialMSTimeout int ReconnectPeriod int HeartBeatPeriod int RCPRandomAdjustment int Compressor string KCP KCPConfig HTTP HTTPConfig Cipher CipherConfig Hops HopServers RemoteSNIProxy map[string]string HibernateAfterSecs int P2PToken string P2S2PEnable bool // contains filtered or unexported fields }
func GetMuxStreamByChannel ¶
func GetMuxStreamByChannel(name string) (mux.MuxStream, *ProxyChannelConfig, error)
func GetMuxStreamByURL ¶
func GetMuxStreamByURL(u *url.URL, defaultUser string, defaultCipher *CipherConfig) (mux.MuxStream, *ProxyChannelConfig, error)
func (*ProxyChannelConfig) Adjust ¶
func (conf *ProxyChannelConfig) Adjust()
func (*ProxyChannelConfig) GetRemoteSNI ¶
func (conf *ProxyChannelConfig) GetRemoteSNI(domain string) string
func (*ProxyChannelConfig) ProxyURL ¶
func (c *ProxyChannelConfig) ProxyURL() *url.URL
type ProxyLimitConfig ¶
func (*ProxyLimitConfig) Allowed ¶
func (limit *ProxyLimitConfig) Allowed(host string) bool
type RateLimitConfig ¶
var DefaultServerRateLimit RateLimitConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.