Registry / networking / kavu-go-reuseport

kavu-go-reuseport

JSON →
library1.5.0gogounverified

Package reuseport provides a net.Listener with SO_REUSEPORT socket option for TCP servers.

go get github.com/kavu/go_reuseport
INSTALL
IMPORT
SIG · KAVU-GO-REUSEPORT
K
kavu-go-reuseport
networkinggov1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reuseport
github.com/kavu/go_reuseport

Creates a TCP listener with SO_REUSEPORT enabled on port 8080.

package main import ( "net/http" "github.com/kavu/go_reuseport" ) func main() { listener, err := reuseport.Listen("tcp", ":8080") if err != nil { panic(err) } http.Serve(listener, nil) }
Debug
Known issues
gotchaSO_REUSEPORT is only supported on Linux and some BSD systems; it will fail on Windows or macOS.
fix
Use build tags or runtime checks to conditionally enable reuseport only on supported platforms.
affects: >=1.0.0
Upgrade
Version history
1.5.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
kavu-go-reuseport — go get kavu-go-reuseport · libregistry