Documentation
¶
Index ¶
- type Control
- func (ctl *Control) Close() error
- func (ctl *Control) CloseProxy(closeMsg *msg.CloseProxy) (err error)
- func (ctl *Control) GetWorkConn() (workConn *proxy.WorkConn, err error)
- func (ctl *Control) ID() ControlID
- func (ctl *Control) RegisterProxy(pxyMsg *msg.NewProxy) (remoteAddr string, err error)
- func (ctl *Control) Replaced(newCtl *Control)
- func (ctl *Control) RunID() string
- func (ctl *Control) Start() bool
- func (ctl *Control) WaitClosed()
- func (ctl *Control) WaitForHandoff()
- type ControlID
- type ControlManager
- func (cm *ControlManager) Activate(ctl *Control) (bool, error)
- func (cm *ControlManager) Add(ctl *Control) error
- func (cm *ControlManager) Close() error
- func (cm *ControlManager) GetByID(runID string) (ctl *Control, ok bool)
- func (cm *ControlManager) RegisterWorkConn(ctl *Control, conn *proxy.WorkConn) error
- func (cm *ControlManager) Remove(ctl *Control) bool
- type Service
- func (svr *Service) Close() error
- func (svr *Service) HandleListener(l net.Listener, internal bool)
- func (svr *Service) HandleQUICListener(l *quic.Listener)
- func (svr *Service) RegisterControl(ctlConn *msg.Conn, loginMsg *msg.Login, internal bool, wireProtocol string) (*Control, error)
- func (svr *Service) RegisterVisitorConn(visitorConn net.Conn, newMsg *msg.NewVisitorConn, wireProtocol string) error
- func (svr *Service) RegisterWorkConn(workConn *msg.Conn, newMsg *msg.NewWorkConn) error
- func (svr *Service) Run(ctx context.Context)
- type SessionContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func NewControl ¶
func NewControl(ctx context.Context, sessionCtx *SessionContext) (*Control, error)
func (*Control) CloseProxy ¶ added in v0.12.0
func (ctl *Control) CloseProxy(closeMsg *msg.CloseProxy) (err error)
func (*Control) GetWorkConn ¶
When frps get one user connection, we get one work connection from the pool and return it. If no workConn available in the pool, send message to frpc to get one or more and wait until it is available. return an error if wait timeout
func (*Control) RegisterProxy ¶
func (*Control) WaitClosed ¶ added in v0.23.0
func (ctl *Control) WaitClosed()
block until Control closed
func (*Control) WaitForHandoff ¶ added in v0.70.1
func (ctl *Control) WaitForHandoff()
type ControlManager ¶
type ControlManager struct {
// contains filtered or unexported fields
}
func NewControlManager ¶
func NewControlManager(clientRegistry *registry.ClientRegistry) *ControlManager
func (*ControlManager) Activate ¶ added in v0.70.1
func (cm *ControlManager) Activate(ctl *Control) (bool, error)
Activate registers ctl as online only if it is still the pending current generation.
func (*ControlManager) Add ¶
func (cm *ControlManager) Add(ctl *Control) error
Add makes ctl the pending current generation and records the predecessor finalization barrier it must wait for before activation.
func (*ControlManager) Close ¶ added in v0.49.0
func (cm *ControlManager) Close() error
func (*ControlManager) GetByID ¶ added in v0.34.0
func (cm *ControlManager) GetByID(runID string) (ctl *Control, ok bool)
func (*ControlManager) RegisterWorkConn ¶ added in v0.70.1
func (cm *ControlManager) RegisterWorkConn(ctl *Control, conn *proxy.WorkConn) error
RegisterWorkConn transfers conn to ctl only if ctl is still the current running generation. On error, ownership remains with the caller.
func (*ControlManager) Remove ¶ added in v0.70.1
func (cm *ControlManager) Remove(ctl *Control) bool
Remove deletes and offlines ctl only if it is still the current generation.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Server service
func NewService ¶
func NewService(cfg *v1.ServerConfig) (*Service, error)
func (*Service) HandleListener ¶ added in v0.12.0
HandleListener accepts connections from client and call handleConnection to handle them. If internal is true, it means that this listener is used for internal communication like ssh tunnel gateway. TODO(fatedier): Pass some parameters of listener/connection through context to avoid passing too many parameters.
func (*Service) HandleQUICListener ¶ added in v0.46.0
func (*Service) RegisterControl ¶
func (*Service) RegisterVisitorConn ¶ added in v0.14.0
func (*Service) RegisterWorkConn ¶
RegisterWorkConn register a new work connection to control and proxies need it.
type SessionContext ¶ added in v0.68.0
type SessionContext struct {
// all resource managers and controllers
RC *controller.ResourceController
// proxy manager
PxyManager *proxy.Manager
// plugin manager
PluginManager *plugin.Manager
// verifies authentication based on selected method
AuthVerifier auth.Verifier
// key used for connection encryption
EncryptionKey []byte
// control connection
Conn *msg.Conn
// login message
LoginMsg *msg.Login
// server configuration
ServerCfg *v1.ServerConfig
// negotiated wire protocol for this client session
WireProtocol string
}
SessionContext encapsulates the input parameters for creating a new Control.