Skip to content

Commit

Permalink
iOS: AppDelegate: Configure the tunnel manager
Browse files Browse the repository at this point in the history
  • Loading branch information
roop committed Dec 29, 2021
1 parent bbe787b commit 252532e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions iOS/UsingWireGuardKit/UsingWireGuardKit/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ extension AppDelegate {
// It would be good to provide the server's domain name or IP address.
protocolConfiguration.serverAddress = "server"

let wgQuickConfig = """
[Interface]
PrivateKey = <private-key>
Address = <ip-addresses>
DNS = <dns-server-ip-addresses>
[Peer]
PublicKey = <public-key>
AllowedIPs = <use 0.0.0.0/0,::0/0 to route everything>
Endpoint = <server>:51820
"""

protocolConfiguration.providerConfiguration = [
"wgQuickConfig": wgQuickConfig
]

tunnelManager.protocolConfiguration = protocolConfiguration
tunnelManager.isEnabled = true

Expand Down

0 comments on commit 252532e

Please sign in to comment.