openvpn_flutter icon indicating copy to clipboard operation
openvpn_flutter copied to clipboard

AllowPackage

Open aQuillaSense opened this issue 3 years ago • 1 comments

Hi,

There is functionality to bypass a package from using the VPN. I wonder how can one achieve the inverse of only allowing certain packages?

aQuillaSense avatar Jun 08 '22 14:06 aQuillaSense

Hello,

You can use this logic:

List<AppInfo> apps = await InstalledApps.getInstalledApps(false, true);

final installedPackages = apps.map((e) => e.packageName).toList();
installedPackages.remove("com.brave.browser");

openvpn.connect(
  config,
  "USA",
  username: defaultVpnUsername,
  password: defaultVpnPassword,
  certIsRequired: true,
  bypassPackages: installedPackages,
);

This will enable the VPN only on Brave.

nogringo avatar Jul 29 '24 08:07 nogringo