mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-18 22:49:10 +00:00
Handle Pool.resolved to use external hostname
This commit is contained in:
parent
c1d8233339
commit
b61906c32f
@ -176,7 +176,7 @@ public extension ProviderConnectionProfile {
|
||||
|
||||
var addresses: [String] {
|
||||
var addrs = pool?.addresses() ?? []
|
||||
if let pool = pool, let externalHostname = try? preset?.externalConfiguration(forKey: .hostname, infrastructureName: infrastructure.name, pool: pool) as? String {
|
||||
if addrs.isEmpty, let pool = pool, !(pool.isResolved ?? false), let externalHostname = try? preset?.externalConfiguration(forKey: .hostname, infrastructureName: infrastructure.name, pool: pool) as? String {
|
||||
addrs.insert(externalHostname, at: 0)
|
||||
}
|
||||
return addrs
|
||||
|
@ -44,6 +44,8 @@ public struct Pool: Codable, Hashable {
|
||||
|
||||
case hostname
|
||||
|
||||
case isResolved = "resolved"
|
||||
|
||||
case numericAddresses = "addrs"
|
||||
}
|
||||
|
||||
@ -63,6 +65,8 @@ public struct Pool: Codable, Hashable {
|
||||
|
||||
public let hostname: String?
|
||||
|
||||
public let isResolved: Bool?
|
||||
|
||||
public let numericAddresses: [UInt32]?
|
||||
|
||||
public func hasAddress(_ address: String) -> Bool {
|
||||
|
Loading…
Reference in New Issue
Block a user