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

@ -406,7 +406,7 @@ func (svr *Service) HandleListener(l net.Listener) {
go func(ctx context.Context, frpConn net.Conn) {
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.Server(frpConn, fmuxCfg)
if err != nil {