simpleConnect static method

Future<void> simpleConnect(
  1. String server,
  2. String username,
  3. String password, {
  4. String? name,
  5. int? port,
  6. int? mtu,
})

Connect to VPN.

Use given credentials to connect VPN (ikev2-eap). This will create a background VPN service. MTU is only available on android.

Implementation

static Future<void> simpleConnect(
  String server,
  String username,
  String password, {
  String? name,
  int? port,
  int? mtu,
}) async {
  await _channel.invokeMethod('connect', {
    'name': name ?? server,
    'server': server,
    'username': username,
    'password': password,
    if (port != null) 'port': port,
    if (mtu != null) 'mtu': mtu,
  });
}