mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
chore: disable tfo when lower than Windows 10.0.14393
This commit is contained in:
parent
a50339bd5f
commit
3ae4014b39
|
@ -164,7 +164,7 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po
|
|||
if opt.mpTcp {
|
||||
setMultiPathTCP(dialer)
|
||||
}
|
||||
if opt.tfo {
|
||||
if opt.tfo && !DisableTFO {
|
||||
return dialTFO(ctx, *dialer, network, address)
|
||||
}
|
||||
return dialer.DialContext(ctx, network, address)
|
||||
|
|
|
@ -9,6 +9,8 @@ import (
|
|||
"github.com/metacubex/tfo-go"
|
||||
)
|
||||
|
||||
var DisableTFO = false
|
||||
|
||||
type tfoConn struct {
|
||||
net.Conn
|
||||
closed bool
|
||||
|
|
11
component/dialer/tfo_windows.go
Normal file
11
component/dialer/tfo_windows.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package dialer
|
||||
|
||||
import "github.com/metacubex/mihomo/constant/features"
|
||||
|
||||
func init() {
|
||||
// According to MSDN, this option is available since Windows 10, 1607
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596(v=vs.85).aspx
|
||||
if features.WindowsMajorVersion < 10 || (features.WindowsMajorVersion == 10 && features.WindowsBuildNumber < 14393) {
|
||||
DisableTFO = true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user