Removed pooled server and add plain resolver

This commit is contained in:
Daniel 2020-07-21 14:58:14 +02:00
parent b87ba37d4c
commit 7b40e83aec
5 changed files with 112 additions and 284 deletions

View file

@ -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
}