Update tfo-go

This commit is contained in:
世界
2023-08-16 17:47:24 +08:00
parent 53a0bf2d11
commit 5c5c25e3ad
16 changed files with 131 additions and 39 deletions

View File

@@ -0,0 +1,18 @@
//go:build !go1.20
package dialer
import (
"net"
E "github.com/sagernet/sing/common/exceptions"
)
type tcpDialer = net.Dialer
func newTCPDialer(dialer net.Dialer, tfoEnabled bool) (tcpDialer, error) {
if tfoEnabled {
return dialer, E.New("TCP Fast Open requires go1.20, please recompile your binary.")
}
return dialer, nil
}