Documentation
¶
Index ¶
- Constants
- func RegisterProxyFactory(proxyConfType reflect.Type, factory func(*BaseProxy, config.ProxyConf) Proxy)
- type BaseProxy
- type GeneralTCPProxy
- type Manager
- func (pm *Manager) Close()
- func (pm *Manager) GetAllProxyStatus() []*WorkingStatus
- func (pm *Manager) HandleEvent(payload interface{}) error
- func (pm *Manager) HandleWorkConn(name string, workConn net.Conn, m *msg.StartWorkConn)
- func (pm *Manager) Reload(pxyCfgs map[string]config.ProxyConf)
- func (pm *Manager) StartProxy(name string, remoteAddr string, serverRespErr string) error
- type Proxy
- func NewGeneralTCPProxy(baseProxy *BaseProxy, _ config.ProxyConf) Proxy
- func NewProxy(ctx context.Context, pxyConf config.ProxyConf, ...) (pxy Proxy)
- func NewSUDPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy
- func NewUDPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy
- func NewXTCPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy
- type SUDPProxy
- type UDPProxy
- type WorkingStatus
- type Wrapper
- type XTCPProxy
Constants ¶
View Source
const ( ProxyPhaseNew = "new" ProxyPhaseWaitStart = "wait start" ProxyPhaseStartErr = "start error" ProxyPhaseRunning = "running" ProxyPhaseCheckFailed = "check failed" ProxyPhaseClosed = "closed" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseProxy ¶
type BaseProxy struct {
// contains filtered or unexported fields
}
func (*BaseProxy) HandleTCPWorkConnection ¶ added in v0.51.1
func (pxy *BaseProxy) HandleTCPWorkConnection(workConn net.Conn, m *msg.StartWorkConn, encKey []byte)
Common handler for tcp work connections.
func (*BaseProxy) InWorkConn ¶ added in v0.51.1
func (pxy *BaseProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type GeneralTCPProxy ¶ added in v0.51.1
type GeneralTCPProxy struct {
*BaseProxy
}
GeneralTCPProxy is a general implementation of Proxy interface for TCP protocol. If the default GeneralTCPProxy cannot meet the requirements, you can customize the implementation of the Proxy interface.
type Manager ¶ added in v0.37.2
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v0.37.2
func NewManager( ctx context.Context, clientCfg config.ClientCommonConf, msgTransporter transport.MessageTransporter, ) *Manager
func (*Manager) GetAllProxyStatus ¶ added in v0.37.2
func (pm *Manager) GetAllProxyStatus() []*WorkingStatus
func (*Manager) HandleEvent ¶ added in v0.37.2
func (*Manager) HandleWorkConn ¶ added in v0.37.2
type Proxy ¶
type Proxy interface { Run() error // InWorkConn accept work connections registered to server. InWorkConn(net.Conn, *msg.StartWorkConn) Close() }
Proxy defines how to handle work connections for different proxy type.
func NewGeneralTCPProxy ¶ added in v0.51.1
func NewProxy ¶
func NewProxy( ctx context.Context, pxyConf config.ProxyConf, clientCfg config.ClientCommonConf, msgTransporter transport.MessageTransporter, ) (pxy Proxy)
func NewSUDPProxy ¶ added in v0.51.1
func NewUDPProxy ¶ added in v0.51.1
type SUDPProxy ¶ added in v0.37.2
type SUDPProxy struct { *BaseProxy // contains filtered or unexported fields }
func (*SUDPProxy) InWorkConn ¶ added in v0.37.2
func (pxy *SUDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn)
type UDPProxy ¶ added in v0.37.2
type UDPProxy struct { *BaseProxy // contains filtered or unexported fields }
func (*UDPProxy) InWorkConn ¶ added in v0.37.2
func (pxy *UDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn)
type WorkingStatus ¶ added in v0.37.2
type Wrapper ¶ added in v0.37.2
type Wrapper struct { WorkingStatus // contains filtered or unexported fields }
func NewWrapper ¶ added in v0.37.2
func (*Wrapper) GetStatus ¶ added in v0.37.2
func (pw *Wrapper) GetStatus() *WorkingStatus
func (*Wrapper) InWorkConn ¶ added in v0.37.2
func (pw *Wrapper) InWorkConn(workConn net.Conn, m *msg.StartWorkConn)
func (*Wrapper) SetRunningStatus ¶ added in v0.37.2
type XTCPProxy ¶ added in v0.37.2
type XTCPProxy struct { *BaseProxy // contains filtered or unexported fields }
func (*XTCPProxy) InWorkConn ¶ added in v0.37.2
func (pxy *XTCPProxy) InWorkConn(conn net.Conn, startWorkConnMsg *msg.StartWorkConn)
Click to show internal directories.
Click to hide internal directories.