server

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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
	LogFile          string = "console"
	LogWay           string = "console" // console or file
	LogLevel         string = "info"
	LogMaxDays       int64  = 3
	PrivilegeMode    bool   = false
	PrivilegeToken   string = ""
	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 added in v0.7.0

func CreateProxy(s *ProxyServer) error

func DeleteProxy added in v0.7.0

func DeleteProxy(proxyName string)

func LoadConf

func LoadConf(confFile string) (err error)

func ReloadConf added in v0.6.0

func ReloadConf(confFile string) (err error)

the function can only reload proxy configures common section won't be changed

func RunDashboardServer added in v0.6.0

func RunDashboardServer(addr string, port int64) (err error)

Types

type GeneralResponse added in v0.6.0

type GeneralResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
}

type Listener added in v0.5.0

type Listener interface {
	Accept() (*conn.Conn, error)
	Close() error
}

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 added in v0.6.0

func NewProxyServer() (p *ProxyServer)

func NewProxyServerFromCtlMsg added in v0.7.0

func NewProxyServerFromCtlMsg(req *msg.ControlReq) (p *ProxyServer)

func (*ProxyServer) Close

func (p *ProxyServer) Close()

func (*ProxyServer) Compare added in v0.6.0

func (p *ProxyServer) Compare(p2 *ProxyServer) bool

func (*ProxyServer) Init

func (p *ProxyServer) Init()

func (*ProxyServer) Lock

func (p *ProxyServer) Lock()

func (*ProxyServer) RegisterNewWorkConn added in v0.6.0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL