openvpn_flutter
2.0.0, released 4 weeks ago by nizwar.dev
Connect to OpenVPN servers from Flutter on Android, iOS and macOS.
WASM-readyCopyleft license
What it does
Allows Flutter applications to establish and manage OpenVPN connections on Android, iOS, and macOS. It provides native engines, stage, traffic, and log streams, per-app VPN routing, and session timeouts.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build a VPN client application supporting Android, iOS, and macOS.
- You require advanced OpenVPN features like per-app VPN or encrypted private keys.
Skip it when
- You only need standard HTTP/REST API calls and do not require a VPN tunnel.
Strengths
- Cross-platform support for Android, iOS, and macOS with a unified Dart API.
- Bundled OpenVPN engines and support for modern requirements like 16 KB page sizes on Android.
- Streams for stage changes, traffic updates, and engine logs.
Weaknesses
- Requires native configuration and setup for Network Extensions on iOS and macOS.
- Android requires specific packaging rules and foreground service permissions.
Setup
- Kind
- Plugin (native code)
- Effort
- High
- Code generation
- No
- Direct dependencies
- 0
Requires native configuration in Android Gradle, creating a Network Extension target and adding App Groups in Xcode for iOS and macOS, plus CocoaPods or SPM integration for OpenVPNAdapter.
import 'package:openvpn_flutter/openvpn_flutter.dart';
late final OpenVPN openvpn;
@override
void initState() {
super.initState();
openvpn = OpenVPN(
onVpnStageChanged: (stage, raw) => setState(() => this.stage = stage),
onVpnStatusChanged: (status) => setState(() => this.status = status),
);
openvpn.initialize(
groupIdentifier: 'group.com.example.vpn',
providerBundleIdentifier: 'com.example.app.VPNExtension',
localizedDescription: 'Example VPN',
);
}Alternatives
Packages that do the same job and could replace openvpn_flutter.