github.com/sagernet/sing-box@v1.9.0-rc.20/inbound/default_tcp_go1.20.go (about)

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