proxy

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProxyPhaseNew         = "新建"
	ProxyPhaseWaitStart   = "等待启动"
	ProxyPhaseStartErr    = "启动错误"
	ProxyPhaseRunning     = "运行中"
	ProxyPhaseCheckFailed = "检查失败"
	ProxyPhaseClosed      = "已关闭"
)

Variables

This section is empty.

Functions

func RegisterProxyFactory

func RegisterProxyFactory(proxyConfType reflect.Type, factory func(*BaseProxy, v1.ProxyConfigurer) Proxy)

Types

type BaseProxy

type BaseProxy struct {
	// contains filtered or unexported fields
}

func (*BaseProxy) Close

func (pxy *BaseProxy) Close()

func (*BaseProxy) HandleTCPWorkConnection

func (pxy *BaseProxy) HandleTCPWorkConnection(workConn net.Conn, m *msg.StartWorkConn, encKey []byte)

Common handler for tcp work connections.

func (*BaseProxy) InWorkConn

func (pxy *BaseProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)

func (*BaseProxy) Run

func (pxy *BaseProxy) Run() error

func (*BaseProxy) SetInWorkConnCallback

func (pxy *BaseProxy) SetInWorkConnCallback(cb func(*v1.ProxyBaseConfig, net.Conn, *msg.StartWorkConn) bool)

type GeneralTCPProxy

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

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(
	ctx context.Context,
	clientCfg *v1.ClientCommonConfig,
	msgTransporter transport.MessageTransporter,
) *Manager

func (*Manager) Close

func (pm *Manager) Close()

func (*Manager) GetAllProxyStatus

func (pm *Manager) GetAllProxyStatus() []*WorkingStatus

func (*Manager) GetProxyStatus

func (pm *Manager) GetProxyStatus(name string) (*