tfo-go provides TCP Fast Open support for the net dialer and listener.
go get github.com/database64128/tfo-go/v2tfo-go's Windows support requires extensive usage of //go:linkname to access Go runtime internals, as there's currently no public API for Windows async IO in the standard library. Unfortunately, the Go team has decided to lock down future uses of linkname, starting with Go 1.23. And our bid to get the linknames we need exempted was partially rejected. Therefore, we had to make the following changes:
- Windows support is gated behind the build tag
tfogo_checklinkname0when building with Go 1.23 and later. - With Go 1.21 and 1.22,
tfo-gov2.2.x still provides full Windows support, with or without the build tag. - With Go 1.23 and later, when the build tag is not specified,
tfo-goonly supportslistenwith TFO on Windows. To get full TFO support on Windows, the build tagtfogo_checklinkname0must be specified along with linker flag-checklinkname=0to disable the linkname check.