Xray and wg fix (#875)

Xray support on iOS fixes
This commit is contained in:
Boris Verbitckii 2024-07-01 23:27:53 +07:00 committed by GitHub
parent 760f935965
commit 2bceb9f7ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 34 deletions

View file

@ -13,7 +13,7 @@ struct WGConfig: Decodable {
let clientIP: String
let clientPrivateKey: String
let serverPublicKey: String
let presharedKey: String
let presharedKey: String?
var allowedIPs: [String]
var persistentKeepAlive: String
let splitTunnelType: Int
@ -65,7 +65,7 @@ struct WGConfig: Decodable {
\(settings)
[Peer]
PublicKey = \(serverPublicKey)
PresharedKey = \(presharedKey)
\(presharedKey == nil ? "" : "PresharedKey = \(presharedKey!)")
AllowedIPs = \(allowedIPs.joined(separator: ", "))
Endpoint = \(hostName):\(port)
PersistentKeepalive = \(persistentKeepAlive)