proxy

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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(localInfo *config.LocalSvrConf, proxyPlugin plugin.Plugin,
	baseInfo *config.BaseProxyConf, workConn frpNet.Conn, encKey []byte)

Common handler for tcp work connections.

Types

type BaseProxy

type BaseProxy struct {
	log.Logger
	// contains filtered or unexported fields
}

type HttpProxy

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

HTTP

func (*HttpProxy) Close

func (pxy *HttpProxy) Close()

func (*HttpProxy) InWorkConn

func (pxy *HttpProxy) InWorkConn(conn frpNet.Conn)

func (*HttpProxy) Run

func (pxy *HttpProxy) Run() (err error)

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 frpNet.Conn)

func (*HttpsProxy) Run

func (pxy *HttpsProxy) Run() (err error)

type Proxy

type Proxy interface {
	Run() error

	// InWorkConn accept work connections registered to server.
	InWorkConn(conn frpNet.Conn)

	Close()
	log.Logger
}

Proxy defines how to handle work connections for different proxy type.

func NewProxy

func NewProxy(pxyConf config.ProxyConf) (pxy Proxy)

type ProxyManager

type ProxyManager struct {
	log.Logger
	// contains filtered or unexported fields
}

func NewProxyManager

func NewProxyManager(msgSendCh chan (msg.Message), logPrefix string) *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 frpNet.Conn)

func (*ProxyManager) Reload

func (pm *ProxyManager) Reload(pxyCfgs map[string]config.ProxyConf)

func (*ProxyManager) StartProxy

func (pm *ProxyManager) StartProxy(name string, remoteAddr string, serverRespErr string) error

type ProxyStatus

type ProxyStatus struct {
	Name   string           `json:"name"`
	Type   string           `json:"type"`
	Status string           `json:"status"`
	Err    string           `json:"err"`
	Cfg    config.ProxyConf `json:"cfg"`

	// Got from server.
	RemoteAddr string `json:"remote_addr"`
}

type ProxyWrapper

type ProxyWrapper struct {
	ProxyStatus

	log.Logger
	// contains filtered or unexported fields
}

func NewProxyWrapper

func NewProxyWrapper(cfg config.ProxyConf, eventHandler event.EventHandler, logPrefix string) *ProxyWrapper

func (*ProxyWrapper) GetStatus

func (pw *ProxyWrapper) GetStatus() *ProxyStatus

func (*ProxyWrapper) InWorkConn

func (pw *ProxyWrapper) InWorkConn(workConn frpNet.Conn)

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) Close

func (pxy *StcpProxy) Close()

func (*StcpProxy) InWorkConn

func (pxy *StcpProxy) InWorkConn(conn frpNet.Conn)

func (*StcpProxy) Run

func (pxy *StcpProxy) Run() (err error)

type TcpProxy

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

TCP

func (*TcpProxy) Close

func (pxy *TcpProxy) Close()

func (*TcpProxy) InWorkConn

func (pxy *TcpProxy) InWorkConn(conn frpNet.Conn)

func (*TcpProxy) Run

func (pxy *TcpProxy) Run() (err error)

type UdpProxy

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

UDP

func (*UdpProxy) Close

func (pxy *UdpProxy) Close()

func (*UdpProxy) InWorkConn

func (pxy *UdpProxy) InWorkConn(conn frpNet.Conn)

func (*UdpProxy) Run

func (pxy *UdpProxy) Run() (err error)

type XtcpProxy

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

XTCP

func (*XtcpProxy) Close

func (pxy *XtcpProxy) Close()

func (*XtcpProxy) InWorkConn

func (pxy *XtcpProxy) InWorkConn(conn frpNet.Conn)

func (*XtcpProxy) Run

func (pxy *XtcpProxy) Run() (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL