Versions in this module Expand all Collapse all v1 v1.0.0 Jun 3, 2024 Changes in this version + const ProxyPhaseCheckFailed + const ProxyPhaseClosed + const ProxyPhaseNew + const ProxyPhaseRunning + const ProxyPhaseStartErr + const ProxyPhaseWaitStart + func RegisterProxyFactory(proxyConfType reflect.Type, factory func(*BaseProxy, v1.ProxyConfigurer) Proxy) + type BaseProxy struct + func (pxy *BaseProxy) Close() + func (pxy *BaseProxy) HandleTCPWorkConnection(workConn net.Conn, m *msg.StartWorkConn, encKey []byte) + func (pxy *BaseProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) + func (pxy *BaseProxy) Run() error + func (pxy *BaseProxy) SetInWorkConnCallback(cb func(*v1.ProxyBaseConfig, net.Conn, *msg.StartWorkConn) bool) + type GeneralTCPProxy struct + type Manager struct + func NewManager(ctx context.Context, clientCfg *v1.ClientCommonConfig, ...) *Manager + func (pm *Manager) Close() + func (pm *Manager) GetAllProxyStatus() []*WorkingStatus + func (pm *Manager) GetProxyStatus(name string) (*WorkingStatus, bool) + func (pm *Manager) HandleEvent(payload interface{}) error + func (pm *Manager) HandleWorkConn(name string, workConn net.Conn, m *msg.StartWorkConn) + func (pm *Manager) SetInWorkConnCallback(cb func(*v1.ProxyBaseConfig, net.Conn, *msg.StartWorkConn) bool) + func (pm *Manager) StartProxy(name string, remoteAddr string, serverRespErr string) error + func (pm *Manager) UpdateAll(proxyCfgs []v1.ProxyConfigurer) + type Proxy interface + Close func() + InWorkConn func(net.Conn, *msg.StartWorkConn) + Run func() error + SetInWorkConnCallback func(func(*v1.ProxyBaseConfig, net.Conn, *msg.StartWorkConn) bool) + func NewGeneralTCPProxy(baseProxy *BaseProxy, _ v1.ProxyConfigurer) Proxy + func NewProxy(ctx context.Context, pxyConf v1.ProxyConfigurer, ...) (pxy Proxy) + func NewSUDPProxy(baseProxy *BaseProxy, cfg v1.ProxyConfigurer) Proxy + func NewUDPProxy(baseProxy *BaseProxy, cfg v1.ProxyConfigurer) Proxy + func NewXTCPProxy(baseProxy *BaseProxy, cfg v1.ProxyConfigurer) Proxy + type SUDPProxy struct + func (pxy *SUDPProxy) Close() + func (pxy *SUDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn) + func (pxy *SUDPProxy) Run() (err error) + type UDPProxy struct + func (pxy *UDPProxy) Close() + func (pxy *UDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn) + func (pxy *UDPProxy) Run() (err error) + type WorkingStatus struct + Cfg v1.ProxyConfigurer + Err string + Name string + Phase string + RemoteAddr string + Type string + type Wrapper struct + func NewWrapper(ctx context.Context, cfg v1.ProxyConfigurer, clientCfg *v1.ClientCommonConfig, ...) *Wrapper + func (pw *Wrapper) GetStatus() *WorkingStatus + func (pw *Wrapper) InWorkConn(workConn net.Conn, m *msg.StartWorkConn) + func (pw *Wrapper) SetInWorkConnCallback(cb func(*v1.ProxyBaseConfig, net.Conn, *msg.StartWorkConn) bool) + func (pw *Wrapper) SetRunningStatus(remoteAddr string, respErr string) error + func (pw *Wrapper) Start() + func (pw *Wrapper) Stop() + type XTCPProxy struct + func (pxy *XTCPProxy) InWorkConn(conn net.Conn, startWorkConnMsg *msg.StartWorkConn)