channel

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: BSD-3-Clause Imports: 22 Imported by: 12

Documentation

Index

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",
}
View Source
var LocalChannelTypeTable map[string]reflect.Type = make(map[string]reflect.Type)

Functions

func AllowedSchema

func AllowedSchema() []string

func DialServerByConf

func DialServerByConf(server string, conf *ProxyChannelConfig) (net.Conn, error)

func DumpLoaclChannelStat

func DumpLoaclChannelStat(w io.Writer)

func InitialPMuxConfig

func InitialPMuxConfig(cipher *CipherConfig) *pmux.Config

func IsDirectScheme

func IsDirectScheme(scheme string) bool

func NewDialByConf

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

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 FeatureSet struct {
	AutoExpire bool
	Pingable   bool
}

type HTTPBaseConfig

type HTTPBaseConfig struct {
	HTTPPushRateLimitPerSec int
	UserAgent               string
	ReadTimeout             int
}

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
}

type KCPConfig

type KCPConfig struct {
	KCPBaseConfig
}

func (*KCPConfig) UnmarshalJSON

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

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
}

func (*MuxConfig) ToPMuxConf

func (m *MuxConfig) ToPMuxConf() *pmux.Config

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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