add support for command line with frpc

This commit is contained in:
fatedier
2016-03-14 00:48:22 +08:00
parent 3218eda481
commit a56b29b153
4 changed files with 72 additions and 15 deletions

View File

@@ -11,11 +11,11 @@ import (
var (
ServerAddr string = "0.0.0.0"
ServerPort int64 = 7000
LogFile string = "./frpc.log"
LogLevel string = "warn"
LogWay string = "file"
HeartBeatInterval int64 = 5
HeartBeatTimeout int64 = 30
LogFile string = "console"
LogWay string = "console"
LogLevel string = "info"
HeartBeatInterval int64 = 20
HeartBeatTimeout int64 = 60
)
var ProxyClients map[string]*ProxyClient = make(map[string]*ProxyClient)
@@ -43,6 +43,11 @@ func LoadConf(confFile string) (err error) {
tmpStr, ok = conf.Get("common", "log_file")
if ok {
LogFile = tmpStr
if LogFile == "console" {
LogWay = "console"
} else {
LogWay = "file"
}
}
tmpStr, ok = conf.Get("common", "log_level")
@@ -50,11 +55,6 @@ func LoadConf(confFile string) (err error) {
LogLevel = tmpStr
}
tmpStr, ok = conf.Get("common", "log_way")
if ok {
LogWay = tmpStr
}
// proxies
for name, section := range conf {
if name != "common" {