mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-25 13:55:37 +08:00
20 lines
338 B
Go
20 lines
338 B
Go
//go:build go1.20
|
|
|
|
package dialer
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/metacubex/tfo-go"
|
|
)
|
|
|
|
type tcpDialer = tfo.Dialer
|
|
|
|
func newTCPDialer(dialer net.Dialer, tfoEnabled bool) (tcpDialer, error) {
|
|
return tfo.Dialer{Dialer: dialer, DisableTFO: !tfoEnabled}, nil
|
|
}
|
|
|
|
func dialerFromTCPDialer(dialer tcpDialer) net.Dialer {
|
|
return dialer.Dialer
|
|
}
|