openvpn_flutter
openvpn_flutter copied to clipboard
AllowPackage
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?
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.