Generate split allowed IPs in protocol configuration.
This commit is contained in:
parent
cf0ccbf0d1
commit
d449817a45
|
@ -64,8 +64,10 @@ extension Tunnel {
|
||||||
if peer.persistentKeepalive > 0 {
|
if peer.persistentKeepalive > 0 {
|
||||||
settingsString += "persistent_keepalive_interval=\(peer.persistentKeepalive)"
|
settingsString += "persistent_keepalive_interval=\(peer.persistentKeepalive)"
|
||||||
}
|
}
|
||||||
if let allowedIPs = peer.allowedIPs {
|
if let allowedIPs = peer.allowedIPs?.split(separator: ",") {
|
||||||
settingsString += "allowed_ip=\(allowedIPs)" // TODO: split on ,
|
allowedIPs.forEach {
|
||||||
|
settingsString += "allowed_ip=\($0.trimmingCharacters(in: .whitespaces))"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return settingsString
|
return settingsString
|
||||||
|
|
Loading…
Reference in New Issue