client

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 BaseVisitor added in v0.14.0

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

type Control

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

func NewControl

func NewControl(svr *Service, pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.ProxyConf) *Control

func (*Control) Close added in v0.13.0

func (ctl *Control) Close() error

func (*Control) NewWorkConn

func (ctl *Control) NewWorkConn()

func (*Control) Run

func (ctl *Control) Run() (err error)

1. login 2. start reader() writer() manager() 3. connection closed 4. In reader(): close closedCh and exit, controler() get it 5. In controler(): close readCh and sendCh, manager() and writer() will exit 6. In controler(): ini readCh, sendCh, closedCh 7. In controler(): start new reader(), writer(), manager() controler() will keep running

type GeneralResponse added in v0.13.0

type GeneralResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
}

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 deal with work connections for different proxy type.

func NewProxy

func NewProxy(ctl *Control, pxyConf config.ProxyConf) (pxy Proxy)

type ReloadResp added in v0.13.0

type ReloadResp struct {
	GeneralResponse
}

api/reload

type Service

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

func NewService

func NewService(pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.ProxyConf) (svr *Service)

func (*Service) Close added in v0.13.0

func (svr *Service) Close() error

func (*Service) Run

func (svr *Service) Run() error

func (*Service) RunAdminServer added in v0.13.0

func (svr *Service) RunAdminServer(addr string, port int64) (err error)

type StcpProxy added in v0.13.0

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

STCP

func (*StcpProxy) Close added in v0.13.0

func (pxy *StcpProxy) Close()

func (*StcpProxy) InWorkConn added in v0.13.0

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

func (*StcpProxy) Run added in v0.13.0

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

type StcpVisitor added in v0.14.0

type StcpVisitor struct {
	BaseVisitor
	// contains filtered or unexported fields
}

func (*StcpVisitor) Close added in v0.14.0

func (sv *StcpVisitor) Close()

func (*StcpVisitor) Run added in v0.14.0

func (sv *StcpVisitor) 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 Visitor added in v0.14.0

type Visitor interface {
	Run() error
	Close()
	log.Logger
}

Visitor is used for forward traffics from local port tot remote service.

func NewVisitor added in v0.14.0

func NewVisitor(ctl *Control, pxyConf config.ProxyConf) (visitor Visitor)

type XtcpProxy added in v0.14.0

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

XTCP

func (*XtcpProxy) Close added in v0.14.0

func (pxy *XtcpProxy) Close()

func (*XtcpProxy) InWorkConn added in v0.14.0

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

func (*XtcpProxy) Run added in v0.14.0

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

type XtcpVisitor added in v0.14.0

type XtcpVisitor struct {
	BaseVisitor
	// contains filtered or unexported fields
}

func (*XtcpVisitor) Close added in v0.14.0

func (sv *XtcpVisitor) Close()

func (*XtcpVisitor) Run added in v0.14.0

func (sv *XtcpVisitor) Run() (err error)

Jump to

Keyboard shortcuts

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