Fix #706 -- rDNS for DOH/DOT clients
This commit is contained in:
14
dnsforward/helpers.go
Normal file
14
dnsforward/helpers.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package dnsforward
|
||||
|
||||
import "net"
|
||||
|
||||
// GetIPString is a helper function that extracts IP address from net.Addr
|
||||
func GetIPString(addr net.Addr) string {
|
||||
switch addr := addr.(type) {
|
||||
case *net.UDPAddr:
|
||||
return addr.IP.String()
|
||||
case *net.TCPAddr:
|
||||
return addr.IP.String()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in New Issue
Block a user