Documentation ¶
Overview ¶
Copyright 2022 gdy, 272288813@qq.com
Copyright 2022 gdy, 272288813@qq.com
Copyright 2022 gdy, 272288813@qq.com
Copyright 2022 gdy, 272288813@qq.com
Copyright 2022 gdy, 272288813@qq.com
Index ¶
- Constants
- func GetGlobalMaxPortForwardsCountLimit() int64
- func GetGlobalTCPPortForwardConnections() int64
- func GetGlobalTCPPortforwardMaxConnections() int64
- func GetGlobalUDPPortForwardGroutineCount() int64
- func GetGlobalUDPReadTargetDataMaxgoroutineCountLimit() int64
- func GetProxyKey(proxyType, listenIP string, listenPort int) string
- func GloBalTCPPortForwardConnectionsAdd(add int64) int64
- func GloBalUDPPortForwardGroutineCountAdd(add int64) int64
- func SetGlobalMaxPortForwardsCountLimit(max int64)
- func SetGlobalTCPPortforwardMaxConnections(max int64)
- func SetGlobalUDPReadTargetDataMaxgoroutineCountLimit(max int64)
- func SetSafeCheck(f func(mode, ip string) bool)
- type BaseProxyConf
- func (p *BaseProxyConf) CopyBuffer(dst io.Writer, src io.Reader, buf []byte, writedataCallback func(int64)) (written int64, err error)
- func (p *BaseProxyConf) GetProxyType() string
- func (p *BaseProxyConf) GetStatus() string
- func (p *BaseProxyConf) GetTrafficIn() int64
- func (p *BaseProxyConf) GetTrafficOut() int64
- func (p *BaseProxyConf) ReceiveDataCallback(nw int64)
- func (p *BaseProxyConf) SendDataCallback(nw int64)
- type Proxy
- type RelayRuleOptions
- type TCPProxy
- type TCPUDPProxyCommonConf
- func (p *TCPUDPProxyCommonConf) AddCurrentConnections(a int64)
- func (p *TCPUDPProxyCommonConf) GetCurrentConnections() int64
- func (p *TCPUDPProxyCommonConf) GetKey() string
- func (p *TCPUDPProxyCommonConf) GetListenIP() string
- func (p *TCPUDPProxyCommonConf) GetListenPort() int
- func (p *TCPUDPProxyCommonConf) GetListentAddress() string
- func (p *TCPUDPProxyCommonConf) GetTargetAddress() string
- func (p *TCPUDPProxyCommonConf) SafeCheck(remodeAddr string) bool
- func (p *TCPUDPProxyCommonConf) SetMaxConnections(max int64)
- func (p *TCPUDPProxyCommonConf) String() string
- type UDPProxy
- func (p *UDPProxy) CheckReadTargetDataGoroutineLimit() error
- func (p *UDPProxy) CheckTargetUDPConnectSessions()
- func (p *UDPProxy) Forwarder(kk int, replych chan *udpPackge)
- func (p *UDPProxy) GetUDPPacketSize() int
- func (p *UDPProxy) ListenHandler(ln *net.UDPConn)
- func (p *UDPProxy) ReadFromTargetOnce() bool
- func (p *UDPProxy) SetUDPPacketSize(size int)
- func (p *UDPProxy) StartProxy()
- func (p *UDPProxy) StopProxy()
Constants ¶
View Source
const DEFAULT_GLOBAL_MAX_CONNECTIONS = int64(1024)
View Source
const DEFAULT_GLOBAL_UDPReadTargetDataMaxgoroutineCount = int64(1024)
View Source
const DEFAULT_MAX_PORTFORWARDS_LIMIT = int64(128)
View Source
const TCPUDP_DEFAULT_SINGLE_PROXY_MAX_CONNECTIONS = int64(256)
View Source
const TCP_DEFAULT_STREAM_BUFFERSIZE = 128
View Source
const UDP_DEFAULT_PACKAGE_SIZE = 1500
Variables ¶
This section is empty.
Functions ¶
func GetGlobalMaxPortForwardsCountLimit ¶
func GetGlobalMaxPortForwardsCountLimit() int64
func GetGlobalTCPPortForwardConnections ¶
func GetGlobalTCPPortForwardConnections() int64
func GetGlobalTCPPortforwardMaxConnections ¶
func GetGlobalTCPPortforwardMaxConnections() int64
func GetGlobalUDPPortForwardGroutineCount ¶
func GetGlobalUDPPortForwardGroutineCount() int64
func GetGlobalUDPReadTargetDataMaxgoroutineCountLimit ¶
func GetGlobalUDPReadTargetDataMaxgoroutineCountLimit() int64
func GetProxyKey ¶
func SetGlobalMaxPortForwardsCountLimit ¶
func SetGlobalMaxPortForwardsCountLimit(max int64)
func SetGlobalTCPPortforwardMaxConnections ¶
func SetGlobalTCPPortforwardMaxConnections(max int64)
func SetGlobalUDPReadTargetDataMaxgoroutineCountLimit ¶
func SetGlobalUDPReadTargetDataMaxgoroutineCountLimit(max int64)
func SetSafeCheck ¶
Types ¶
type BaseProxyConf ¶
type BaseProxyConf struct { TrafficIn int64 TrafficOut int64 ProxyType string // tcp tcp4 tcp6 udp udp4 udp6 // contains filtered or unexported fields }
func (*BaseProxyConf) CopyBuffer ¶
func (*BaseProxyConf) GetProxyType ¶
func (p *BaseProxyConf) GetProxyType() string
func (*BaseProxyConf) GetStatus ¶
func (p *BaseProxyConf) GetStatus() string
func (*BaseProxyConf) GetTrafficIn ¶
func (p *BaseProxyConf) GetTrafficIn() int64
func (*BaseProxyConf) GetTrafficOut ¶
func (p *BaseProxyConf) GetTrafficOut() int64
func (*BaseProxyConf) ReceiveDataCallback ¶
func (p *BaseProxyConf) ReceiveDataCallback(nw int64)
func (*BaseProxyConf) SendDataCallback ¶
func (p *BaseProxyConf) SendDataCallback(nw int64)
type Proxy ¶
type Proxy interface { StartProxy() StopProxy() ReceiveDataCallback(int64) SendDataCallback(int64) GetProxyType() string GetStatus() string GetListenIP() string GetListenPort() int GetKey() string GetCurrentConnections() int64 String() string GetTrafficIn() int64 GetTrafficOut() int64 SafeCheck(ip string) bool }
func CreateProxy ¶
type RelayRuleOptions ¶
type RelayRuleOptions struct { UDPPackageSize int `json:"UDPPackageSize,omitempty"` SingleProxyMaxTCPConnections int64 `json:"SingleProxyMaxTCPConnections,omitempty"` SingleProxyMaxUDPReadTargetDatagoroutineCount int64 `json:"SingleProxyMaxUDPReadTargetDatagoroutineCount"` UDPProxyPerformanceMode bool `json:"UDPProxyPerformanceMode,omitempty"` UDPShortMode bool `json:"UDPShortMode,omitempty"` SafeMode string `json:"SafeMode,omitempty"` }
type TCPProxy ¶
type TCPProxy struct { TCPUDPProxyCommonConf // contains filtered or unexported fields }
func CreateTCPProxy ¶
func (*TCPProxy) CheckConnectionsLimit ¶
func (*TCPProxy) StartProxy ¶
func (p *TCPProxy) StartProxy()
type TCPUDPProxyCommonConf ¶
type TCPUDPProxyCommonConf struct { CurrentConnectionsCount int64 SingleProxyMaxConnections int64 BaseProxyConf // contains filtered or unexported fields }
func (*TCPUDPProxyCommonConf) AddCurrentConnections ¶
func (p *TCPUDPProxyCommonConf) AddCurrentConnections(a int64)
func (*TCPUDPProxyCommonConf) GetCurrentConnections ¶
func (p *TCPUDPProxyCommonConf) GetCurrentConnections() int64
func (*TCPUDPProxyCommonConf) GetKey ¶
func (p *TCPUDPProxyCommonConf) GetKey() string
func (*TCPUDPProxyCommonConf) GetListenIP ¶
func (p *TCPUDPProxyCommonConf) GetListenIP() string
func (*TCPUDPProxyCommonConf) GetListenPort ¶
func (p *TCPUDPProxyCommonConf) GetListenPort() int
func (*TCPUDPProxyCommonConf) GetListentAddress ¶
func (p *TCPUDPProxyCommonConf) GetListentAddress() string
func (*TCPUDPProxyCommonConf) GetTargetAddress ¶
func (p *TCPUDPProxyCommonConf) GetTargetAddress() string
func (*TCPUDPProxyCommonConf) SafeCheck ¶
func (p *TCPUDPProxyCommonConf) SafeCheck(remodeAddr string) bool
func (*TCPUDPProxyCommonConf) SetMaxConnections ¶
func (p *TCPUDPProxyCommonConf) SetMaxConnections(max int64)
func (*TCPUDPProxyCommonConf) String ¶
func (p *TCPUDPProxyCommonConf) String() string
type UDPProxy ¶
type UDPProxy struct { //BaseProxyConf TCPUDPProxyCommonConf Upm bool //性能模式 ShortMode bool SingleProxyMaxUDPReadTargetDatagoroutineCount int64 // contains filtered or unexported fields }
func CreateUDPProxy ¶
func (*UDPProxy) CheckReadTargetDataGoroutineLimit ¶
func (*UDPProxy) CheckTargetUDPConnectSessions ¶
func (p *UDPProxy) CheckTargetUDPConnectSessions()
func (*UDPProxy) GetUDPPacketSize ¶
func (*UDPProxy) ListenHandler ¶
func (*UDPProxy) ReadFromTargetOnce ¶
ReadFromTargetOnce one clientAddr only read once,short mode eg: udp dns
func (*UDPProxy) SetUDPPacketSize ¶
func (*UDPProxy) StartProxy ¶
func (p *UDPProxy) StartProxy()
Click to show internal directories.
Click to hide internal directories.