chore: better apply tcp keepalive to listeners

This commit is contained in:
wwqgtxx
2024-09-24 21:42:28 +08:00
parent 6c0383026e
commit a4e84f0479
30 changed files with 180 additions and 100 deletions

View File

@@ -12,6 +12,7 @@ import (
"sync"
"time"
"github.com/metacubex/mihomo/component/keepalive"
"github.com/metacubex/mihomo/component/resolver"
"github.com/metacubex/mihomo/log"
)
@@ -144,6 +145,7 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po
}
dialer := netDialer.(*net.Dialer)
keepalive.SetNetDialer(dialer)
if opt.mpTcp {
setMultiPathTCP(dialer)
}