Sync Zonghengjia iPhone and iPad 1.0.4 source candidate
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import Foundation
|
||||
|
||||
enum NetworkAddress {
|
||||
static func tunnelUnderlayIPv4(_ remoteAddress: String) -> [String] {
|
||||
let managementAddress = "47.104.134.190"
|
||||
if isAuthorizedInternalIPv4(remoteAddress) {
|
||||
// Preserve the management gateway and the three company relays.
|
||||
return [remoteAddress, managementAddress, "8.216.53.107", "47.254.94.29", "192.236.188.22"]
|
||||
}
|
||||
guard isPublicIPv4(remoteAddress), remoteAddress != managementAddress else { return [managementAddress] }
|
||||
return [remoteAddress, managementAddress]
|
||||
}
|
||||
|
||||
static func isAuthorizedInternalIPv4(_ value: String) -> Bool {
|
||||
let parts = value.split(separator: ".", omittingEmptySubsequences: false)
|
||||
guard parts.count == 4 else { return false }
|
||||
|
||||
Reference in New Issue
Block a user