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) error
- func SetDefaultMuxConfig(cfg MuxConfig)
- func StopLocalChannels()
- type CipherConfig
- type FeatureSet
- type HTTPBaseConfig
- type HTTPConfig
- type HopServers
- type KCPBaseConfig
- type KCPConfig
- type LocalChannel
- type LocalProxyChannel
- type MuxConfig
- type ProxyChannelConfig
Constants ¶
View Source
const DirectChannelName = "direct"
View Source
const LocalVersion = "r15"
'r1' means revision 1
View Source
const RemoteVersion = "r12"
Variables ¶
View Source
var DirectSchemes = []string{ DirectChannelName, "socks", "socks4", "socks5", "http_proxy", }
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) error
func SetDefaultMuxConfig ¶
func SetDefaultMuxConfig(cfg MuxConfig)
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 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 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 ¶
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 // 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) ProxyURL ¶
func (c *ProxyChannelConfig) ProxyURL() *url.URL
Click to show internal directories.
Click to hide internal directories.