|
|
|
@ -11,16 +11,16 @@ import (
|
|
|
|
|
|
|
|
|
|
// common config
|
|
|
|
|
var ( |
|
|
|
|
ServerAddr string = "0.0.0.0" |
|
|
|
|
ServerPort int64 = 7000 |
|
|
|
|
LogFile string = "./frpc.log" |
|
|
|
|
LogLevel string = "warn" |
|
|
|
|
LogWay string = "file" |
|
|
|
|
ServerAddr string = "0.0.0.0" |
|
|
|
|
ServerPort int64 = 7000 |
|
|
|
|
LogFile string = "./frpc.log" |
|
|
|
|
LogLevel string = "warn" |
|
|
|
|
LogWay string = "file" |
|
|
|
|
HeartBeatInterval int64 = 5 |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var ProxyClients map[string]*models.ProxyClient = make(map[string]*models.ProxyClient) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func LoadConf(confFile string) (err error) { |
|
|
|
|
var tmpStr string |
|
|
|
|
var ok bool |
|
|
|
@ -56,6 +56,11 @@ func LoadConf(confFile string) (err error) {
|
|
|
|
|
LogWay = tmpStr |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tmpStr, ok = conf.Get("common", "heartbeat_interval") |
|
|
|
|
if ok { |
|
|
|
|
HeartBeatInterval, _ = strconv.ParseInt(tmpStr, 10, 64) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// servers
|
|
|
|
|
for name, section := range conf { |
|
|
|
|
if name != "common" { |
|
|
|
|