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 ¶
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 ¶
type HTTPProxy struct { *BaseProxy // contains filtered or unexported fields }
HTTP
func (*HTTPProxy) InWorkConn ¶
func (pxy *HTTPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type HTTPSProxy ¶
type HTTPSProxy struct { *BaseProxy // contains filtered or unexported fields }
HTTPS
func (*HTTPSProxy) Close ¶
func (pxy *HTTPSProxy) Close()
func (*HTTPSProxy) InWorkConn ¶
func (pxy *HTTPSProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
func (*HTTPSProxy) Run ¶
func (pxy *HTTPSProxy) Run() (err error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) GetAllProxyStatus ¶
func (pm *Manager) GetAllProxyStatus() []*WorkingStatus
func (*Manager) HandleEvent ¶
func (*Manager) HandleWorkConn ¶
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 ¶
type STCPProxy struct { *BaseProxy // contains filtered or unexported fields }
STCP
func (*STCPProxy) InWorkConn ¶
func (pxy *STCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type SUDPProxy ¶
type SUDPProxy struct { *BaseProxy // contains filtered or unexported fields }
func (*SUDPProxy) InWorkConn ¶
func (pxy *SUDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type TCPMuxProxy ¶
type TCPMuxProxy struct { *BaseProxy // contains filtered or unexported fields }
TCP Multiplexer
func (*TCPMuxProxy) Close ¶
func (pxy *TCPMuxProxy) Close()
func (*TCPMuxProxy) InWorkConn ¶
func (pxy *TCPMuxProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
func (*TCPMuxProxy) Run ¶
func (pxy *TCPMuxProxy) Run() (err error)
type TCPProxy ¶
type TCPProxy struct { *BaseProxy // contains filtered or unexported fields }
TCP
func (*TCPProxy) InWorkConn ¶
func (pxy *TCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type UDPProxy ¶
type UDPProxy struct { *BaseProxy // contains filtered or unexported fields }
UDP
func (*UDPProxy) InWorkConn ¶
func (pxy *UDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
type WorkingStatus ¶
type Wrapper ¶
type Wrapper struct { WorkingStatus // contains filtered or unexported fields }
func NewWrapper ¶
func (*Wrapper) GetStatus ¶
func (pw *Wrapper) GetStatus() *WorkingStatus
func (*Wrapper) InWorkConn ¶
func (pw *Wrapper) InWorkConn(workConn net.Conn, m *msg.StartWorkConn)
func (*Wrapper) SetRunningStatus ¶
type XTCPProxy ¶
type XTCPProxy struct { *BaseProxy // contains filtered or unexported fields }
XTCP
func (*XTCPProxy) InWorkConn ¶
func (pxy *XTCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn)
Click to show internal directories.
Click to hide internal directories.