chore: add android feature and patch

This commit is contained in:
Steve Johnson
2023-11-17 13:19:24 +08:00
parent b73382f60a
commit d9cfdc3242
6 changed files with 67 additions and 17 deletions

View File

@@ -6,6 +6,8 @@ import (
"github.com/metacubex/mihomo/adapter/inbound"
"github.com/metacubex/mihomo/common/cache"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/constant/features"
"golang.org/x/exp/slices"
)
type Listener struct {
@@ -65,6 +67,11 @@ func NewWithAuthenticate(addr string, tunnel C.Tunnel, authenticate bool, additi
}
continue
}
if slices.Contains(features.TAGS, "cmfa") {
if t, ok := conn.(*net.TCPConn); ok {
t.SetKeepAlive(false)
}
}
go HandleConn(conn, tunnel, c, additions...)
}
}()