Download the PHP package projectmata/mobile-openvpn without Composer
On this page you can find all versions of the php package projectmata/mobile-openvpn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download projectmata/mobile-openvpn
More information about projectmata/mobile-openvpn
Files in projectmata/mobile-openvpn
Package mobile-openvpn
Short Description OpenVPN client plugin for NativePHP Mobile
License MIT
Informations about the package mobile-openvpn
Projectmata Mobile OpenVPN
OpenVPN client plugin for NativePHP Mobile. Lets a Laravel + NativePHP mobile app bring up, tear down, and inspect an OpenVPN tunnel on Android and iOS.
Heads-up — native runtime required. Unlike biometrics or geolocation, neither Android nor iOS ship an OpenVPN implementation. This package scaffolds the bridge, PHP facade, and JS API but you must integrate an OpenVPN runtime (see Native integration) before
Connectactually opens a tunnel.
Requirements
- PHP
^8.1 - Laravel
^11.0or^12.0/^13.0 nativephp/mobile- Android:
min_version 33 - iOS:
min_version 18.2+ a Network Extension target in your app
Installation
Laravel auto-discovery registers the service provider and facade. Rebuild the mobile app so NativePHP bundles the native plugin:
Usage
PHP (Laravel)
JavaScript (in-app)
The plugin registers itself on window.NativePHP.OpenVpn:
Bridge methods
| Method | Params | Returns |
|---|---|---|
OpenVpn.IsSupported |
— | { success, supported } |
OpenVpn.RequestPermission |
— | { success, granted, message? } |
OpenVpn.Connect |
{ profile, username?, password?, displayName? } |
{ success, status, displayName } |
OpenVpn.Disconnect |
— | { success, status } |
OpenVpn.GetStatus |
— | { success, status } |
status is one of disconnected, connecting, or connected.
Native integration
Android
This package does not declare a default OpenVPN runtime dependency because popular Android OpenVPN implementations are not published as ordinary Maven Central artifacts. Vendor ics-openvpn or your chosen runtime into your app, then update resources/android/src/main/java/com/projectmata/mobileopenvpn/OpenVpnPlugin.kt Connect.execute() to:
- Parse the
.ovpnprofile viaConfigParser. - Build a
VpnProfile. - Start
OpenVPNServicewithVPNLaunchHelper.startOpenVpn(profile, context).
Also wire an Activity Result callback if your runtime needs to report back once the user grants consent.
iOS
Apple does not provide OpenVPN. Add a Network Extension target to your Xcode project backed by OpenVPNAdapter (SPM or CocoaPods). In Connect.execute():
- Create a
NETunnelProviderProtocolwhoseproviderBundleIdentifiermatches your NE target. - Pass the
.ovpnbytes, username, and password viaproviderConfiguration. saveToPreferences→connection.startVPNTunnel().
You'll also need the Personal VPN and Network Extensions entitlements on both the host app and the NE target, plus a matching provisioning profile (Apple does not grant these to free accounts).
Permissions
- Android:
INTERNET,ACCESS_NETWORK_STATE,FOREGROUND_SERVICEare declared by this package. The system additionally shows a VPN consent dialog the first time you callRequestPermission(). - iOS: No runtime permission prompt; the user sees a "Allow [App] to Add VPN Configurations?" system dialog the first time the profile is saved.
Licensing caveats
Most Android OpenVPN stacks (ics-openvpn, openvpn-for-android) are GPL-v2. Linking them into your app may propagate GPL obligations to your app binary. If that is a concern, consider:
- A permissively-licensed alternative (OpenVPN3 core, Apache 2.0 — more work to integrate).
- Switching to WireGuard, which has a permissive implementation on both platforms.
OpenVPNAdapter on iOS wraps openvpn3 and is typically AGPL — review before shipping commercially.
License
MIT (scaffold code). The OpenVPN runtime you link against carries its own license — see above.