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

20 lines
338 B
Go
Raw Normal View History

2023-08-16 09:47:24 +00:00
//go:build go1.20
package dialer
import (
"net"
2024-08-27 03:23:20 +00:00
"github.com/metacubex/tfo-go"
2023-08-16 09:47:24 +00: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 11:37:10 +00:00
func dialerFromTCPDialer(dialer tcpDialer) net.Dialer {
return dialer.Dialer
}