mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 04:17:38 +03:00
13 lines
283 B
Go
13 lines
283 B
Go
package control
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
func ReuseAddr() Func {
|
|
return func(network, address string, conn syscall.RawConn) error {
|
|
return Raw(conn, func(fd uintptr) error {
|
|
return syscall.SetsockoptInt(syscall.Handle(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
|
|
})
|
|
}
|
|
}
|