mirror of
https://github.com/fatedier/frp.git
synced 2025-07-14 01:42:21 +07:00
client: add login_fail_exit params, default is true
if login_fail_exit is false, when frpc first login to server failed, it will continues relogin to server every 30 seconds.
This commit is contained in:
@ -38,6 +38,7 @@ type ClientCommonConf struct {
|
||||
PoolCount int
|
||||
TcpMux bool
|
||||
User string
|
||||
LoginFailExit bool
|
||||
HeartBeatInterval int64
|
||||
HeartBeatTimeout int64
|
||||
}
|
||||
@ -56,6 +57,7 @@ func GetDeaultClientCommonConf() *ClientCommonConf {
|
||||
PoolCount: 1,
|
||||
TcpMux: true,
|
||||
User: "",
|
||||
LoginFailExit: true,
|
||||
HeartBeatInterval: 30,
|
||||
HeartBeatTimeout: 90,
|
||||
}
|
||||
@ -134,6 +136,13 @@ func LoadClientCommonConf(conf ini.File) (cfg *ClientCommonConf, err error) {
|
||||
cfg.User = tmpStr
|
||||
}
|
||||
|
||||
tmpStr, ok = conf.Get("common", "login_fail_exit")
|
||||
if ok && tmpStr == "false" {
|
||||
cfg.LoginFailExit = false
|
||||
} else {
|
||||
cfg.LoginFailExit = true
|
||||
}
|
||||
|
||||
tmpStr, ok = conf.Get("common", "heartbeat_timeout")
|
||||
if ok {
|
||||
v, err = strconv.ParseInt(tmpStr, 10, 64)
|
||||
|
Reference in New Issue
Block a user