mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
Support direct ip in lookupIP function
So users can supply ip directly in config, avoiding unnecessary domain lookup while bootstrapping.
This commit is contained in:
committed by
Cuong Manh Le
parent
b7ccfcb8b4
commit
c651003cc4
@@ -473,6 +473,9 @@ func LookupIP(domain string) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func lookupIP(domain string, timeout int) (ips []string) {
|
func lookupIP(domain string, timeout int) (ips []string) {
|
||||||
|
if net.ParseIP(domain) != nil {
|
||||||
|
return []string{domain}
|
||||||
|
}
|
||||||
resolverMutex.Lock()
|
resolverMutex.Lock()
|
||||||
if or == nil {
|
if or == nil {
|
||||||
ProxyLogger.Load().Debug().Msgf("Initialize OS resolver in lookupIP")
|
ProxyLogger.Load().Debug().Msgf("Initialize OS resolver in lookupIP")
|
||||||
|
|||||||
Reference in New Issue
Block a user