Wireguard Transport
Wireguard is a modern, fast, and secure VPN protocol. It aims to be simpler, leaner, and more performant than other VPN protocols like IPSec and OpenVPN. WireguardSDK
allows developers to easily integrate WireGuard VPN functionality into their iOS applications. With WireguardSDK
, you can establish secure VPN connections, manage configurations, and control the VPN lifecycle directly from your app's code.
Initializing WireguardSDK
To get started, you'll need to import the VPNApplicationSDK
and create a WireguardConfiguration
object with your specific settings:
Be sure to replace YOUR_CARRIER_ID
with your actual carrier ID and update the extensionBundleID
and groupID
to match your app's settings.
Establishing a Connection
Once the SDK is initialized and the user is logged in, you can start a VPN connection with a single function call:
This will establish a connection using the optimal location and no proxy. You can customize these settings as needed.
Updating Configuration
If you need to update the Wireguard configuration without creating a new SDK instance, you can use the updateConfiguration
method:
You can't update the configuration if a connection is active. You'll need to call stopVPN
first. Also, if you change the main configuration parameters (hostURL
, carrierID
, extensionBundleID
, groupData
), you'll need to create a new WireguardSDK
instance instead of updating.
Disconnecting
To stop the VPN connection:
Last updated