server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: Apache-2.0 Imports: 12 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
	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
	HeartBeatTimeout int64  = 90
	UserConnTimeout  int64  = 10

	VhostMuxer        *vhost.HttpMuxer
	ProxyServers      map[string]*ProxyServer = make(map[string]*ProxyServer) // all proxy servers info and resources
	ProxyServersMutex sync.RWMutex
)

common config

Functions

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 {
	Name          string
	AuthToken     string
	Type          string
	BindAddr      string
	ListenPort    int64
	CustomDomains []string

	// configure in frpc.ini
	UseEncryption bool

	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 (*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