Documentation ¶
Index ¶
- Constants
- func HandleTCPWorkConnection(ctx context.Context, localInfo *config.LocalSvrConf, proxyPlugin plugin.Plugin, ...)
- type BaseProxy
- type HTTPProxy
- type HTTPSProxy
- type Manager
- func (pm *Manager) Close()
- func (pm *Manager) GetAllProxyStatus() []*WorkingStatus
- func (pm *Manager) HandleEvent(evType event.Type, 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
- type STCPProxy
- type SUDPProxy
- type TCPMuxProxy
- type TCPProxy
- 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 ¶
func HandleTCPWorkConnection ¶ added in v1.0.0
func HandleTCPWorkConnection(ctx context.Context, localInfo *config.LocalSvrConf, proxyPlugin plugin.Plugin, baseInfo *config.BaseProxyConf, limiter *rate.Limiter, workConn net.Conn, encKey []byte, m *msg.StartWorkConn)
Common handler for tcp work connections.
Types ¶
type HTTPProxy ¶ added in v1.0.0
type HTTPProxy struct { *BaseProxy // contains filtered or unexported fields }
HTTP
func (*HTTPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *HTTPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type HTTPSProxy ¶ added in v1.0.0
type HTTPSProxy struct { *BaseProxy // contains filtered or unexported fields }
HTTPS
func (*HTTPSProxy) Close ¶ added in v1.0.0
func (pxy *HTTPSProxy) Close()
func (*HTTPSProxy) InWorkConn ¶ added in v1.0.0
func (pxy *HTTPSProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
func (*HTTPSProxy) Run ¶ added in v1.0.0
func (pxy *HTTPSProxy) Run() (err error)
type Manager ¶ added in v1.0.0
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v1.0.0
func (*Manager) GetAllProxyStatus ¶ added in v1.0.0
func (pm *Manager) GetAllProxyStatus() []*WorkingStatus
func (*Manager) HandleEvent ¶ added in v1.0.0
func (*Manager) HandleWorkConn ¶ added in v1.0.0
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.
type STCPProxy ¶ added in v1.0.0
type STCPProxy struct { *BaseProxy // contains filtered or unexported fields }
STCP
func (*STCPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *STCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type SUDPProxy ¶ added in v1.0.0
type SUDPProxy struct { *BaseProxy // contains filtered or unexported fields }
func (*SUDPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *SUDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type TCPMuxProxy ¶ added in v1.0.0
type TCPMuxProxy struct { *BaseProxy // contains filtered or unexported fields }
TCP Multiplexer
func (*TCPMuxProxy) Close ¶ added in v1.0.0
func (pxy *TCPMuxProxy) Close()
func (*TCPMuxProxy) InWorkConn ¶ added in v1.0.0
func (pxy *TCPMuxProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
func (*TCPMuxProxy) Run ¶ added in v1.0.0
func (pxy *TCPMuxProxy) Run() (err error)
type TCPProxy ¶ added in v1.0.0
type TCPProxy struct { *BaseProxy // contains filtered or unexported fields }
TCP
func (*TCPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *TCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type UDPProxy ¶ added in v1.0.0
type UDPProxy struct { *BaseProxy // contains filtered or unexported fields }
UDP
func (*UDPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *UDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type WorkingStatus ¶ added in v1.0.0
type Wrapper ¶ added in v1.0.0
type Wrapper struct { WorkingStatus // contains filtered or unexported fields }
func NewWrapper ¶ added in v1.0.0
func (*Wrapper) GetStatus ¶ added in v1.0.0
func (pw *Wrapper) GetStatus() *WorkingStatus
func (*Wrapper) InWorkConn ¶ added in v1.0.0
func (pw *Wrapper) InWorkConn(workConn net.Conn, m *msg.StartWorkConn)
func (*Wrapper) SetRunningStatus ¶ added in v1.0.0
type XTCPProxy ¶ added in v1.0.0
type XTCPProxy struct { *BaseProxy // contains filtered or unexported fields }
XTCP
func (*XTCPProxy) InWorkConn ¶ added in v1.0.0
func (pxy *XTCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
Click to show internal directories.
Click to hide internal directories.