support tcp keepalive params (#2863)

This commit is contained in:
fatedier
2022-03-22 19:29:30 +08:00
committed by GitHub
parent 452fe25cc6
commit 100d556336
11 changed files with 29 additions and 8 deletions

View File

@ -40,6 +40,9 @@ type ClientCommonConf struct {
ServerPort int `ini:"server_port" json:"server_port"`
// The maximum amount of time a dial to server will wait for a connect to complete.
DialServerTimeout int64 `ini:"dial_server_timeout" json:"dial_server_timeout"`
// DialServerKeepAlive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
// If negative, keep-alive probes are disabled.
DialServerKeepAlive int64 `ini:"dial_server_keepalive" json:"dial_server_keepalive"`
// ConnectServerLocalIP specifies the address of the client bind when it connect to server.
// By default, this value is empty.
// this value only use in TCP/Websocket protocol. Not support in KCP protocol.
@ -163,6 +166,7 @@ func GetDefaultClientConf() ClientCommonConf {
ServerAddr: "0.0.0.0",
ServerPort: 7000,
DialServerTimeout: 10,
DialServerKeepAlive: 7200,
HTTPProxy: os.Getenv("http_proxy"),
LogFile: "console",
LogWay: "console",