mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
chore: force to disable mptcp for tproxy
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/metacubex/mihomo/component/keepalive"
|
||||
"github.com/metacubex/mihomo/component/mptcp"
|
||||
"github.com/metacubex/mihomo/component/resolver"
|
||||
)
|
||||
|
||||
@@ -140,9 +141,7 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po
|
||||
|
||||
dialer := netDialer.(*net.Dialer)
|
||||
keepalive.SetNetDialer(dialer)
|
||||
if opt.mpTcp {
|
||||
setMultiPathTCP(dialer)
|
||||
}
|
||||
mptcp.SetNetDialer(dialer, opt.mpTcp)
|
||||
|
||||
if DefaultSocketHook != nil { // ignore interfaceName, routingMark and tfo when DefaultSocketHook not null (in CMFA)
|
||||
socketHookToToDialer(dialer)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
//go:build !go1.21
|
||||
|
||||
package dialer
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
const multipathTCPAvailable = false
|
||||
|
||||
func setMultiPathTCP(dialer *net.Dialer) {
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//go:build go1.21
|
||||
|
||||
package dialer
|
||||
|
||||
import "net"
|
||||
|
||||
const multipathTCPAvailable = true
|
||||
|
||||
func setMultiPathTCP(dialer *net.Dialer) {
|
||||
dialer.SetMultipathTCP(true)
|
||||
}
|
||||
23
component/mptcp/mptcp_go120.go
Normal file
23
component/mptcp/mptcp_go120.go
Normal file
@@ -0,0 +1,23 @@
|
||||
//go:build !go1.21
|
||||
|
||||
package mptcp
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
const MultipathTCPAvailable = false
|
||||
|
||||
func SetNetDialer(dialer *net.Dialer, open bool) {
|
||||
}
|
||||
|
||||
func GetNetDialer(dialer *net.Dialer) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func SetNetListenConfig(listenConfig *net.ListenConfig, open bool) {
|
||||
}
|
||||
|
||||
func GetNetListenConfig(listenConfig *net.ListenConfig) bool {
|
||||
return false
|
||||
}
|
||||
23
component/mptcp/mptcp_go121.go
Normal file
23
component/mptcp/mptcp_go121.go
Normal file
@@ -0,0 +1,23 @@
|
||||
//go:build go1.21
|
||||
|
||||
package mptcp
|
||||
|
||||
import "net"
|
||||
|
||||
const MultipathTCPAvailable = true
|
||||
|
||||
func SetNetDialer(dialer *net.Dialer, open bool) {
|
||||
dialer.SetMultipathTCP(open)
|
||||
}
|
||||
|
||||
func GetNetDialer(dialer *net.Dialer) bool {
|
||||
return dialer.MultipathTCP()
|
||||
}
|
||||
|
||||
func SetNetListenConfig(listenConfig *net.ListenConfig, open bool) {
|
||||
listenConfig.SetMultipathTCP(open)
|
||||
}
|
||||
|
||||
func GetNetListenConfig(listenConfig *net.ListenConfig) bool {
|
||||
return listenConfig.MultipathTCP()
|
||||
}
|
||||
Reference in New Issue
Block a user