allow to disable application layer heartbeat to reduce traffic cost (#2758)

fix #2754
This commit is contained in:
fatedier
2022-01-13 14:26:07 +08:00
committed by GitHub
parent 4bfc89d988
commit 293003fcdb
11 changed files with 228 additions and 146 deletions

View File

@@ -249,7 +249,7 @@ func (svr *Service) login() (conn net.Conn, session *fmux.Session, err error) {
if svr.cfg.TCPMux {
fmuxCfg := fmux.DefaultConfig()
fmuxCfg.KeepAliveInterval = 20 * time.Second
fmuxCfg.KeepAliveInterval = time.Duration(svr.cfg.TCPMuxKeepaliveInterval) * time.Second
fmuxCfg.LogOutput = io.Discard
session, err = fmux.Client(conn, fmuxCfg)
if err != nil {