Documentation ¶
Index ¶
- type BaseOutConf
- type Control
- func (ctl *Control) Close() error
- func (ctl *Control) CloseProxy(closeMsg *msg.CloseProxy) (err error)
- func (ctl *Control) GetWorkConn() (workConn net.Conn, err error)
- func (ctl *Control) HandleNatHoleClient(m *msg.NatHoleClient)
- func (ctl *Control) HandleNatHoleReport(m *msg.NatHoleReport)
- func (ctl *Control) HandleNatHoleVisitor(m *msg.NatHoleVisitor)
- func (ctl *Control) RegisterProxy(pxyMsg *msg.NewProxy) (remoteAddr string, err error)
- func (ctl *Control) RegisterWorkConn(conn net.Conn) error
- func (ctl *Control) Replaced(newCtl *Control)
- func (ctl *Control) Start()
- func (ctl *Control) WaitClosed()
- type ControlManager
- type GeneralResponse
- type GetProxyInfoResp
- type GetProxyStatsResp
- type GetProxyTrafficResp
- type HTTPOutConf
- type HTTPSOutConf
- type ProxyStatsInfo
- type STCPOutConf
- type Service
- func (svr *Service) APIProxyByType(w http.ResponseWriter, r *http.Request)
- func (svr *Service) APIProxyByTypeAndName(w http.ResponseWriter, r *http.Request)
- func (svr *Service) APIProxyTraffic(w http.ResponseWriter, r *http.Request)
- func (svr *Service) APIServerInfo(w http.ResponseWriter, r *http.Request)
- func (svr *Service) Close() error
- func (svr *Service) HandleListener(l net.Listener)
- func (svr *Service) HandleQUICListener(l *quic.Listener)
- func (svr *Service) Healthz(w http.ResponseWriter, _ *http.Request)
- func (svr *Service) RegisterControl(ctlConn net.Conn, loginMsg *msg.Login) (err error)
- func (svr *Service) RegisterVisitorConn(visitorConn net.Conn, newMsg *msg.NewVisitorConn) error
- func (svr *Service) RegisterWorkConn(workConn net.Conn, newMsg *msg.NewWorkConn) error
- func (svr *Service) Run(ctx context.Context)
- func (svr *Service) RunDashboardServer(address string) (err error)
- type TCPMuxOutConf
- type TCPOutConf
- type UDPOutConf
- type XTCPOutConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseOutConf ¶ added in v0.20.0
type BaseOutConf struct {
v1.ProxyBaseConfig
}
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func NewControl ¶
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) HandleNatHoleClient ¶ added in v0.52.4
func (ctl *Control) HandleNatHoleClient(m *msg.NatHoleClient)
func (*Control) HandleNatHoleReport ¶ added in v0.52.4
func (ctl *Control) HandleNatHoleReport(m *msg.NatHoleReport)
func (*Control) HandleNatHoleVisitor ¶ added in v0.52.4
func (ctl *Control) HandleNatHoleVisitor(m *msg.NatHoleVisitor)
func (*Control) RegisterProxy ¶
func (*Control) Start ¶
func (ctl *Control) Start()
Start send a login success message to client and start working.
func (*Control) WaitClosed ¶ added in v0.23.0
func (ctl *Control) WaitClosed()
block until Control closed
type ControlManager ¶
type ControlManager struct {
// contains filtered or unexported fields
}
func NewControlManager ¶
func NewControlManager() *ControlManager
func (*ControlManager) Add ¶
func (cm *ControlManager) Add(runID string, ctl *Control) (old *Control)
func (*ControlManager) Close ¶ added in v0.52.4
func (cm *ControlManager) Close() error
func (*ControlManager) Del ¶ added in v0.23.0
func (cm *ControlManager) Del(runID string, ctl *Control)
we should make sure if it's the same control to prevent delete a new one
type GeneralResponse ¶
type GetProxyInfoResp ¶
type GetProxyInfoResp struct {
Proxies []*ProxyStatsInfo `json:"proxies"`
}
type GetProxyStatsResp ¶ added in v0.17.0
type GetProxyStatsResp struct { Name string `json:"name"` Conf interface{} `json:"conf"` TodayTrafficIn int64 `json:"todayTrafficIn"` TodayTrafficOut int64 `json:"todayTrafficOut"` CurConns int64 `json:"curConns"` LastStartTime string `json:"lastStartTime"` LastCloseTime string `json:"lastCloseTime"` Status string `json:"status"` }
Get proxy info by name.
type GetProxyTrafficResp ¶
type GetProxyTrafficResp struct { Name string `json:"name"` TrafficIn []int64 `json:"trafficIn"` TrafficOut []int64 `json:"trafficOut"` }
/api/traffic/:name
type HTTPOutConf ¶ added in v0.52.4
type HTTPOutConf struct { BaseOutConf v1.DomainConfig Locations []string `json:"locations"` HostHeaderRewrite string `json:"hostHeaderRewrite"` }
type HTTPSOutConf ¶ added in v0.52.4
type HTTPSOutConf struct { BaseOutConf v1.DomainConfig }
type ProxyStatsInfo ¶
type ProxyStatsInfo struct { Name string `json:"name"` Conf interface{} `json:"conf"` ClientVersion string `json:"clientVersion,omitempty"` TodayTrafficIn int64 `json:"todayTrafficIn"` TodayTrafficOut int64 `json:"todayTrafficOut"` CurConns int64 `json:"curConns"` LastStartTime string `json:"lastStartTime"` LastCloseTime string `json:"lastCloseTime"` Status string `json:"status"` }
Get proxy info.
type STCPOutConf ¶ added in v0.52.4
type STCPOutConf struct {
BaseOutConf
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Server service
func NewService ¶
func NewService(cfg *v1.ServerConfig) (svr *Service, err error)
func (*Service) APIProxyByType ¶ added in v0.52.4
func (svr *Service) APIProxyByType(w http.ResponseWriter, r *http.Request)
/api/proxy/:type
func (*Service) APIProxyByTypeAndName ¶ added in v0.52.4
func (svr *Service) APIProxyByTypeAndName(w http.ResponseWriter, r *http.Request)
/api/proxy/:type/:name
func (*Service) APIProxyTraffic ¶ added in v0.52.4
func (svr *Service) APIProxyTraffic(w http.ResponseWriter, r *http.Request)
func (*Service) APIServerInfo ¶ added in v0.52.4
func (svr *Service) APIServerInfo(w http.ResponseWriter, r *http.Request)
/api/serverinfo
func (*Service) HandleListener ¶ added in v0.12.0
func (*Service) HandleQUICListener ¶ added in v0.52.4
func (*Service) Healthz ¶ added in v0.52.4
func (svr *Service) Healthz(w http.ResponseWriter, _ *http.Request)
/healthz
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.
func (*Service) RunDashboardServer ¶ added in v0.23.0
type TCPMuxOutConf ¶ added in v0.52.4
type TCPMuxOutConf struct { BaseOutConf v1.DomainConfig Multiplexer string `json:"multiplexer"` }
type TCPOutConf ¶ added in v0.52.4
type TCPOutConf struct { BaseOutConf RemotePort int `json:"remotePort"` }
type UDPOutConf ¶ added in v0.52.4
type UDPOutConf struct { BaseOutConf RemotePort int `json:"remotePort"` }
type XTCPOutConf ¶ added in v0.52.4
type XTCPOutConf struct {
BaseOutConf
}
Click to show internal directories.
Click to hide internal directories.