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) 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) HandleListener(l net.Listener)
- func (svr *Service) Mutex() *mux.Mux
- 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()
- func (svr *Service) RunDashboardServer(addr string, port int) (err error)
- func (svr *Service) Stop() (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 ¶
type BaseOutConf struct {
config.BaseProxyConf
}
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func NewControl ¶
func (*Control) CloseProxy ¶
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 ¶
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 ¶
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 ¶
type GetProxyStatsResp 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 by name.
type GetProxyTrafficResp ¶
type GetProxyTrafficResp struct { Name string `json:"name"` TrafficIn []int64 `json:"traffic_in"` TrafficOut []int64 `json:"traffic_out"` }
api/traffic/:name
type HTTPOutConf ¶
type HTTPOutConf struct { BaseOutConf config.DomainConf Locations []string `json:"locations"` HostHeaderRewrite string `json:"host_header_rewrite"` }
type HTTPSOutConf ¶
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 STCPOutConf ¶
type STCPOutConf struct {
BaseOutConf
}
type Service ¶
type Service struct { // Closed is service closed Closed bool // contains filtered or unexported fields }
Server service
func NewService ¶
func NewService(cfg config.ServerCommonConf) (svr *Service, err error)
func (*Service) APIProxyByType ¶
func (svr *Service) APIProxyByType(w http.ResponseWriter, r *http.Request)
api/proxy/:type
func (*Service) APIProxyByTypeAndName ¶
func (svr *Service) APIProxyByTypeAndName(w http.ResponseWriter, r *http.Request)
api/proxy/:type/:name
func (*Service) APIProxyTraffic ¶
func (svr *Service) APIProxyTraffic(w http.ResponseWriter, r *http.Request)
func (*Service) APIServerInfo ¶
func (svr *Service) APIServerInfo(w http.ResponseWriter, r *http.Request)
api/serverinfo
func (*Service) HandleListener ¶
func (*Service) RegisterControl ¶
func (*Service) RegisterVisitorConn ¶
func (*Service) RegisterWorkConn ¶
RegisterWorkConn register a new work connection to control and proxies need it.
func (*Service) RunDashboardServer ¶
type TCPMuxOutConf ¶
type TCPMuxOutConf struct { BaseOutConf config.DomainConf Multiplexer string `json:"multiplexer"` }
type TCPOutConf ¶
type TCPOutConf struct { BaseOutConf RemotePort int `json:"remote_port"` }
type UDPOutConf ¶
type UDPOutConf struct { BaseOutConf RemotePort int `json:"remote_port"` }
type XTCPOutConf ¶
type XTCPOutConf struct {
BaseOutConf
}
Click to show internal directories.
Click to hide internal directories.