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

20 lines
338 B
Go
Raw Permalink Normal View History

2023-08-16 17:47:24 +08:00
//go:build go1.20
package dialer
import (
"net"
2024-08-27 11:23:20 +08:00
"github.com/metacubex/tfo-go"
2023-08-16 17:47:24 +08:00
)
type tcpDialer = tfo.Dialer
func newTCPDialer(dialer net.Dialer, tfoEnabled bool) (tcpDialer, error) {
return tfo.Dialer{Dialer: dialer, DisableTFO: !tfoEnabled}, nil
}
2024-11-12 19:37:10 +08:00
func dialerFromTCPDialer(dialer tcpDialer) net.Dialer {
return dialer.Dialer
}