mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-12 08:08:50 +00:00
19 lines
371 B
Go
19 lines
371 B
Go
//go:build go1.20
|
|
|
|
package inbound
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
|
|
"github.com/metacubex/tfo-go"
|
|
)
|
|
|
|
const go120Available = true
|
|
|
|
func listenTFO(listenConfig net.ListenConfig, ctx context.Context, network string, address string) (net.Listener, error) {
|
|
var tfoConfig tfo.ListenConfig
|
|
tfoConfig.ListenConfig = listenConfig
|
|
return tfoConfig.Listen(ctx, network, address)
|
|
}
|