Documentation ¶
Index ¶
- type BaseOutConf
- type Control
- func (ctl *Control) CloseProxy(closeMsg *msg.CloseProxy) (err error)
- func (ctl *Control) GetWorkConn() (workConn net.Conn, err error)
- func (ctl *Control) RegisterProxy(pxyMsg *msg.NewProxy) (remoteAddr string, err error)
- func (ctl *Control) RegisterWorkConn(conn net.Conn)
- 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 ServerInfoResp
- 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) HandleListener(l frpNet.Listener)
- func (svr *Service) RegisterControl(ctlConn frpNet.Conn, loginMsg *msg.Login) (err error)
- func (svr *Service) RegisterVisitorConn(visitorConn frpNet.Conn, newMsg *msg.NewVisitorConn) error
- func (svr *Service) RegisterWorkConn(workConn frpNet.Conn, newMsg *msg.NewWorkConn)
- func (svr *Service) Run()
- func (svr *Service) RunDashboardServer(addr string, port int) (err error)
- type StcpOutConf
- 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 {
config.BaseProxyConf
}
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func NewControl ¶
func NewControl(rc *controller.ResourceController, pxyManager *proxy.ProxyManager, statsCollector stats.Collector, ctlConn net.Conn, loginMsg *msg.Login) *Control
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) RegisterWorkConn ¶
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) (oldCtl *Control)
func (*ControlManager) Del ¶ added in v0.23.0
func (cm *ControlManager) Del(runId string)
type GeneralResponse ¶
type GetProxyInfoResp ¶
type GetProxyInfoResp struct { GeneralResponse Proxies []*ProxyStatsInfo `json:"proxies"` }
type GetProxyStatsResp ¶ added in v0.17.0
type GetProxyStatsResp struct { GeneralResponse Name string `json:"name"` Conf interface{} `json:"conf"` TodayTrafficIn int64 `json:"today_traffic_in"` TodayTrafficOut int64 `json:"today_traffic_out"` CurConns int64 `json:"cur_conns"` LastStartTime string `json:"last_start_time"` LastCloseTime string `json:"last_close_time"` Status string `json:"status"` }
Get proxy info by name.
type GetProxyTrafficResp ¶
type GetProxyTrafficResp struct { GeneralResponse Name string `json:"name"` TrafficIn []int64 `json:"traffic_in"` TrafficOut []int64 `json:"traffic_out"` }
api/traffic/:name
type HttpOutConf ¶ added in v0.20.0
type HttpOutConf struct { BaseOutConf config.DomainConf Locations []string `json:"locations"` HostHeaderRewrite string `json:"host_header_rewrite"` }
type HttpsOutConf ¶ added in v0.20.0
type HttpsOutConf struct { BaseOutConf config.DomainConf }
type ProxyStatsInfo ¶
type ProxyStatsInfo struct { Name string `json:"name"` Conf interface{} `json:"conf"` TodayTrafficIn int64 `json:"today_traffic_in"` TodayTrafficOut int64 `json:"today_traffic_out"` CurConns int64 `json:"cur_conns"` LastStartTime string `json:"last_start_time"` LastCloseTime string `json:"last_close_time"` Status string `json:"status"` }
Get proxy info.
type ServerInfoResp ¶
type ServerInfoResp struct { GeneralResponse Version string `json:"version"` BindPort int `json:"bind_port"` BindUdpPort int `json:"bind_udp_port"` VhostHttpPort int `json:"vhost_http_port"` VhostHttpsPort int `json:"vhost_https_port"` KcpBindPort int `json:"kcp_bind_port"` SubdomainHost string `json:"subdomain_host"` MaxPoolCount int64 `json:"max_pool_count"` MaxPortsPerClient int64 `json:"max_ports_per_client"` HeartBeatTimeout int64 `json:"heart_beat_timeout"` TotalTrafficIn int64 `json:"total_traffic_in"` TotalTrafficOut int64 `json:"total_traffic_out"` CurConns int64 `json:"cur_conns"` ClientCounts int64 `json:"client_counts"` ProxyTypeCounts map[string]int64 `json:"proxy_type_count"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Server service
var ServerService *Service
func NewService ¶
func (*Service) ApiProxyByType ¶ added in v0.23.0
func (svr *Service) ApiProxyByType(w http.ResponseWriter, r *http.Request)
api/proxy/:type
func (*Service) ApiProxyByTypeAndName ¶ added in v0.23.0
func (svr *Service) ApiProxyByTypeAndName(w http.ResponseWriter, r *http.Request)
api/proxy/:type/:name
func (*Service) ApiProxyTraffic ¶ added in v0.23.0
func (svr *Service) ApiProxyTraffic(w http.ResponseWriter, r *http.Request)
func (*Service) ApiServerInfo ¶ added in v0.23.0
func (svr *Service) ApiServerInfo(w http.ResponseWriter, r *http.Request)
api/serverinfo
func (*Service) HandleListener ¶ added in v0.12.0
func (*Service) RegisterControl ¶
func (*Service) RegisterVisitorConn ¶ added in v0.14.0
func (*Service) RegisterWorkConn ¶
func (svr *Service) RegisterWorkConn(workConn frpNet.Conn, newMsg *msg.NewWorkConn)
RegisterWorkConn register a new work connection to control and proxies need it.
type StcpOutConf ¶ added in v0.20.0
type StcpOutConf struct {
BaseOutConf
}
type TcpOutConf ¶ added in v0.20.0
type TcpOutConf struct { BaseOutConf RemotePort int `json:"remote_port"` }
type UdpOutConf ¶ added in v0.20.0
type UdpOutConf struct { BaseOutConf RemotePort int `json:"remote_port"` }
type XtcpOutConf ¶ added in v0.20.0
type XtcpOutConf struct {
BaseOutConf
}
Click to show internal directories.
Click to hide internal directories.