Documentation ¶
Index ¶
- Constants
- func HandleTcpWorkConnection(ctx context.Context, localInfo *config.LocalSvrConf, proxyPlugin plugin.Plugin, ...)
- type BaseProxy
- type HttpProxy
- type HttpsProxy
- type Proxy
- type ProxyManager
- func (pm *ProxyManager) Close()
- func (pm *ProxyManager) GetAllProxyStatus() []*ProxyStatus
- func (pm *ProxyManager) HandleEvent(evType event.EventType, payload interface{}) error
- func (pm *ProxyManager) HandleWorkConn(name string, workConn net.Conn, m *msg.StartWorkConn)
- func (pm *ProxyManager) Reload(pxyCfgs map[string]config.ProxyConf)
- func (pm *ProxyManager) StartProxy(name string, remoteAddr string, serverRespErr string) error
- type ProxyStatus
- type ProxyWrapper
- type StcpProxy
- type TcpMuxProxy
- type TcpProxy
- type UdpProxy
- type XtcpProxy
Constants ¶
View Source
const ( ProxyStatusNew = "new" ProxyStatusWaitStart = "wait start" ProxyStatusStartErr = "start error" ProxyStatusRunning = "running" ProxyStatusCheckFailed = "check failed" ProxyStatusClosed = "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 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 ProxyManager ¶
type ProxyManager struct {
// contains filtered or unexported fields
}
func NewProxyManager ¶
func NewProxyManager(ctx context.Context, msgSendCh chan (msg.Message), clientCfg config.ClientCommonConf, serverUDPPort int) *ProxyManager
func (*ProxyManager) Close ¶
func (pm *ProxyManager) Close()
func (*ProxyManager) GetAllProxyStatus ¶
func (pm *ProxyManager) GetAllProxyStatus() []*ProxyStatus
func (*ProxyManager) HandleEvent ¶
func (pm *ProxyManager) HandleEvent(evType event.EventType, payload interface{}) error
func (*ProxyManager) HandleWorkConn ¶
func (pm *ProxyManager) HandleWorkConn(name string, workConn net.Conn, m *msg.StartWorkConn)
func (*ProxyManager) StartProxy ¶
func (pm *ProxyManager) StartProxy(name string, remoteAddr string, serverRespErr string) error
type ProxyStatus ¶
type ProxyWrapper ¶
type ProxyWrapper struct { ProxyStatus // contains filtered or unexported fields }
func NewProxyWrapper ¶
func NewProxyWrapper(ctx context.Context, cfg config.ProxyConf, clientCfg config.ClientCommonConf, eventHandler event.EventHandler, serverUDPPort int) *ProxyWrapper
func (*ProxyWrapper) GetStatus ¶
func (pw *ProxyWrapper) GetStatus() *ProxyStatus
func (*ProxyWrapper) InWorkConn ¶
func (pw *ProxyWrapper) InWorkConn(workConn net.Conn, m *msg.StartWorkConn)
func (*ProxyWrapper) SetRunningStatus ¶
func (pw *ProxyWrapper) SetRunningStatus(remoteAddr string, respErr string) error
func (*ProxyWrapper) Start ¶
func (pw *ProxyWrapper) Start()
func (*ProxyWrapper) Stop ¶
func (pw *ProxyWrapper) Stop()
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 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 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.