mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-05 05:27:31 +00:00
chore: listening tcp together for dns server (#1792)
This commit is contained in:
15
component/dialer/reuse.go
Normal file
15
component/dialer/reuse.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user