sing-box/common/dialer/default_nongo1.20.go

23 lines
411 B
Go
Raw Normal View History

2023-08-16 09:47:24 +00:00
//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
}
2024-11-12 11:37:10 +00:00
func dialerFromTCPDialer(dialer tcpDialer) net.Dialer {
return dialer
}