mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-05 00:53:58 -04:00
[client] Eliminate upstream server strings in dns code (#4267)
This commit is contained in:
@@ -102,6 +102,11 @@ func (n *NameServer) IsEqual(other *NameServer) bool {
|
||||
other.Port == n.Port
|
||||
}
|
||||
|
||||
// AddrPort returns the nameserver as a netip.AddrPort
|
||||
func (n *NameServer) AddrPort() netip.AddrPort {
|
||||
return netip.AddrPortFrom(n.IP, uint16(n.Port))
|
||||
}
|
||||
|
||||
// ParseNameServerURL parses a nameserver url in the format <type>://<ip>:<port>, e.g., udp://1.1.1.1:53
|
||||
func ParseNameServerURL(nsURL string) (NameServer, error) {
|
||||
parsedURL, err := url.Parse(nsURL)
|
||||
|
||||
Reference in New Issue
Block a user