mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-10 04:20:55 +00:00
15 lines
308 B
Go
15 lines
308 B
Go
package dialer
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"syscall"
|
|
|
|
"github.com/metacubex/mihomo/common/sockopt"
|
|
)
|
|
|
|
func addrReuseToListenConfig(lc *net.ListenConfig) {
|
|
addControlToListenConfig(lc, func(ctx context.Context, network, address string, c syscall.RawConn) error {
|
|
return sockopt.RawConnReuseaddr(c)
|
|
})
|
|
}
|