mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-12-27 12:35:39 +08:00
18 lines
251 B
Go
18 lines
251 B
Go
package outboundgroup
|
|
|
|
import (
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
func tcpKeepAlive(c net.Conn) {
|
|
if tcp, ok := c.(*net.TCPConn); ok {
|
|
_ = tcp.SetKeepAlive(true)
|
|
_ = tcp.SetKeepAlivePeriod(30 * time.Second)
|
|
}
|
|
}
|
|
|
|
type SelectAble interface {
|
|
Set(string) error
|
|
}
|