default_tcp_go1.20.go 371 B

123456789101112131415161718
  1. //go:build go1.20
  2. package inbound
  3. import (
  4. "context"
  5. "net"
  6. "github.com/metacubex/tfo-go"
  7. )
  8. const go120Available = true
  9. func listenTFO(listenConfig net.ListenConfig, ctx context.Context, network string, address string) (net.Listener, error) {
  10. var tfoConfig tfo.ListenConfig
  11. tfoConfig.ListenConfig = listenConfig
  12. return tfoConfig.Listen(ctx, network, address)
  13. }