mirror of
https://github.com/safing/portmaster
synced 2025-09-13 08:19:41 +00:00
Removed pooled server and add plain resolver
This commit is contained in:
parent
b87ba37d4c
commit
7b40e83aec
5 changed files with 112 additions and 284 deletions
|
@ -2,6 +2,7 @@ package resolver
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -94,3 +95,21 @@ func start() error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
localAddrFactory func(network string) net.Addr
|
||||
)
|
||||
|
||||
// SetLocalAddrFactory supplies the intel package with a function to get permitted local addresses for connections.
|
||||
func SetLocalAddrFactory(laf func(network string) net.Addr) {
|
||||
if localAddrFactory == nil {
|
||||
localAddrFactory = laf
|
||||
}
|
||||
}
|
||||
|
||||
func getLocalAddr(network string) net.Addr {
|
||||
if localAddrFactory != nil {
|
||||
return localAddrFactory(network)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue