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 GetGlobalConnections() int64
- func GetGlobalMaxConnections() int64
- func GetGlobalMaxProxyCount() int64
- func GetProxyKey(proxyType, listenIP string, listenPort int) string
- func GetSingleProxyMaxConnections(m *int64) int64
- func GloBalCOnnectionsAdd(add int64) int64
- func SetGlobalMaxConnections(max int64)
- func SetGlobalMaxProxyCount(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) FromRule() string
- 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)
- func (p *BaseProxyConf) SetFromRule(rule string)
- type Proxy
- type RelayRuleOptions
- type TCPProxy
- type TCPUDPProxyCommonConf
- func (p *TCPUDPProxyCommonConf) AddCurrentConnections(a int64)
- func (p *TCPUDPProxyCommonConf) CheckConnections() bool
- 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) PrintConnectionsInfo()
- func (p *TCPUDPProxyCommonConf) SafeCheck(remodeAddr string) bool
- func (p *TCPUDPProxyCommonConf) SetMaxConnections(max int64)
- func (p *TCPUDPProxyCommonConf) String() string
- type UDPProxy
- func (p *UDPProxy) CheckTargetUDPConn()
- func (p *UDPProxy) Forwarder(kk int, replych chan *udpPackge)
- func (p *UDPProxy) GetStatus() string
- func (p *UDPProxy) GetUDPPacketSize() int
- func (p *UDPProxy) ListenFunc(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(10240)
View Source
const DEFAULT_MAX_PROXY_COUNT = 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 GetGlobalConnections ¶
func GetGlobalConnections() int64
func GetGlobalMaxConnections ¶
func GetGlobalMaxConnections() int64
func GetGlobalMaxProxyCount ¶
func GetGlobalMaxProxyCount() int64
func GetProxyKey ¶
func GloBalCOnnectionsAdd ¶
func SetGlobalMaxConnections ¶
func SetGlobalMaxConnections(max int64)
func SetGlobalMaxProxyCount ¶
func SetGlobalMaxProxyCount(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) FromRule ¶
func (p *BaseProxyConf) FromRule() string
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)
func (*BaseProxyConf) SetFromRule ¶
func (p *BaseProxyConf) SetFromRule(rule string)
type Proxy ¶
type Proxy interface { StartProxy() StopProxy() ReceiveDataCallback(int64) SendDataCallback(int64) GetProxyType() string GetStatus() string GetListenIP() string GetListenPort() int GetKey() string GetCurrentConnections() int64 SetFromRule(string) FromRule() string String() string GetTrafficIn() int64 GetTrafficOut() int64 SafeCheck(ip string) bool }
func CreateProxy ¶
type RelayRuleOptions ¶
type RelayRuleOptions struct { UDPPackageSize int `json:"UDPPackageSize,omitempty"` SingleProxyMaxConnections int64 `json:"SingleProxyMaxConnections,omitempty"` 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 CreateTCPProxy(proxyType, listenIP, targetIP string, balanceTargetAddressList *[]string, listenPort, targetPort int, options *RelayRuleOptions) *TCPProxy
func (*TCPProxy) GetCurrentCon ¶
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) CheckConnections ¶
func (p *TCPUDPProxyCommonConf) CheckConnections() bool
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) PrintConnectionsInfo ¶
func (p *TCPUDPProxyCommonConf) PrintConnectionsInfo()
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 // contains filtered or unexported fields }
func CreateUDPProxy ¶
func CreateUDPProxy(proxyType, listenIP, targetIP string, balanceTargetAddressList *[]string, listenPort, targetPort int, options *RelayRuleOptions) *UDPProxy
func (*UDPProxy) CheckTargetUDPConn ¶
func (p *UDPProxy) CheckTargetUDPConn()
func (*UDPProxy) GetUDPPacketSize ¶
func (*UDPProxy) ListenFunc ¶
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.