mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 12:42:27 +08:00
16 lines
255 B
Go
16 lines
255 B
Go
//go:build go1.23
|
|
|
|
package net
|
|
|
|
import "net"
|
|
|
|
func TCPKeepAlive(c net.Conn) {
|
|
if tcp, ok := c.(*net.TCPConn); ok {
|
|
_ = tcp.SetKeepAliveConfig(net.KeepAliveConfig{
|
|
Enable: true,
|
|
Idle: KeepAliveIdle,
|
|
Interval: KeepAliveInterval,
|
|
})
|
|
}
|
|
}
|