Documentation ¶
Index ¶
- Variables
- func CreateProxy(s *ProxyServer) error
- func DeleteProxy(proxyName string)
- func LoadConf(confFile string) (err error)
- func ReloadConf(confFile string) (err error)
- func RunDashboardServer(addr string, port int64) (err error)
- type GeneralResponse
- type Listener
- type ProxiesResponse
- type ProxyServer
- func (p *ProxyServer) Close()
- func (p *ProxyServer) Compare(p2 *ProxyServer) bool
- func (p *ProxyServer) Init()
- func (p *ProxyServer) Lock()
- func (p *ProxyServer) RegisterNewWorkConn(c *conn.Conn)
- func (p *ProxyServer) Start(c *conn.Conn) (err error)
- func (p *ProxyServer) Unlock()
- func (p *ProxyServer) WaitUserConn() (closeFlag bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConfigFile string = "./frps.ini" BindAddr string = "0.0.0.0" BindPort int64 = 7000 VhostHttpPort int64 = 0 // if VhostHttpPort equals 0, don't listen a public port for http protocol VhostHttpsPort int64 = 0 // if VhostHttpsPort equals 0, don't listen a public port for https protocol DashboardPort int64 = 0 // if DashboardPort equals 0, dashboard is not available AssetsDir string = "" LogFile string = "console" LogWay string = "console" // console or file LogLevel string = "info" LogMaxDays int64 = 3 PrivilegeMode bool = false PrivilegeToken string = "" // if PrivilegeAllowPorts is not nil, tcp proxies which remote port exist in this map can be connected PrivilegeAllowPorts map[int64]struct{} MaxPoolCount int64 = 100 HeartBeatTimeout int64 = 90 UserConnTimeout int64 = 10 VhostHttpMuxer *vhost.HttpMuxer VhostHttpsMuxer *vhost.HttpsMuxer ProxyServers map[string]*ProxyServer = make(map[string]*ProxyServer) // all proxy servers info and resources ProxyServersMutex sync.RWMutex )
common config
Functions ¶
func CreateProxy ¶
func CreateProxy(s *ProxyServer) error
func DeleteProxy ¶
func DeleteProxy(proxyName string)
func ReloadConf ¶
the function can only reload proxy configures common section won't be changed
func RunDashboardServer ¶
Types ¶
type GeneralResponse ¶
type ProxiesResponse ¶
type ProxiesResponse struct { Code int64 `json:"code"` Msg string `json:"msg"` Proxies []*metric.ServerMetric `json:"proxies"` }
type ProxyServer ¶
type ProxyServer struct { config.BaseConf BindAddr string ListenPort int64 CustomDomains []string Status int64 CtlConn *conn.Conn // control connection with frpc // contains filtered or unexported fields }
func NewProxyServer ¶
func NewProxyServer() (p *ProxyServer)
func NewProxyServerFromCtlMsg ¶
func NewProxyServerFromCtlMsg(req *msg.ControlReq) (p *ProxyServer)
func (*ProxyServer) Close ¶
func (p *ProxyServer) Close()
func (*ProxyServer) Compare ¶
func (p *ProxyServer) Compare(p2 *ProxyServer) bool
func (*ProxyServer) Init ¶
func (p *ProxyServer) Init()
func (*ProxyServer) Lock ¶
func (p *ProxyServer) Lock()
func (*ProxyServer) RegisterNewWorkConn ¶
func (p *ProxyServer) RegisterNewWorkConn(c *conn.Conn)
func (*ProxyServer) Start ¶
func (p *ProxyServer) Start(c *conn.Conn) (err error)
start listening for user conns
func (*ProxyServer) Unlock ¶
func (p *ProxyServer) Unlock()
func (*ProxyServer) WaitUserConn ¶
func (p *ProxyServer) WaitUserConn() (closeFlag bool)
Click to show internal directories.
Click to hide internal directories.