PHPackages                             projectmata/mobile-openvpn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. projectmata/mobile-openvpn

ActiveNativephp-plugin[Utility &amp; Helpers](/categories/utility)

projectmata/mobile-openvpn
==========================

OpenVPN client plugin for NativePHP Mobile

v1.0.0(1mo ago)03↓100%MITKotlinPHP ^8.1

Since Apr 25Pushed 1mo agoCompare

[ Source](https://github.com/jomarmata24/mobile-openvpn)[ Packagist](https://packagist.org/packages/projectmata/mobile-openvpn)[ RSS](/packages/projectmata-mobile-openvpn/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Projectmata Mobile OpenVPN
==========================

[](#projectmata-mobile-openvpn)

[![Latest Version](https://camo.githubusercontent.com/713f6fb91f1ae292857cb01906c3dc2cf73f38ec9da578a40ca1a77fc5940dee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6a6563746d6174612f6d6f62696c652d6f70656e76706e2e737667)](https://packagist.org/packages/projectmata/mobile-openvpn)[![Total Downloads](https://camo.githubusercontent.com/1cfb5ffdecb3b3711fa7c0406fd2ee7c6c9fac12645305171d392bb7f7aa44af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726f6a6563746d6174612f6d6f62696c652d6f70656e76706e2e737667)](https://packagist.org/packages/projectmata/mobile-openvpn)[![License](https://camo.githubusercontent.com/5efd797de1ddc8277d6ee42dcdf15fac45558598134a85b2ed43abfba69097e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70726f6a6563746d6174612f6d6f62696c652d6f70656e76706e2e737667)](https://packagist.org/packages/projectmata/mobile-openvpn)

OpenVPN client plugin for [NativePHP Mobile](https://nativephp.com). 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](#native-integration)) before `Connect` actually opens a tunnel.

Requirements
------------

[](#requirements)

- PHP `^8.1`
- Laravel `^11.0` or `^12.0` / `^13.0`
- `nativephp/mobile`
- Android: `min_version 33`
- iOS: `min_version 18.2` + a Network Extension target in your app

Installation
------------

[](#installation)

```
composer require projectmata/mobile-openvpn
```

Laravel auto-discovery registers the service provider and facade. Rebuild the mobile app so NativePHP bundles the native plugin:

```
php artisan native:run android
# or
php artisan native:run ios
```

Usage
-----

[](#usage)

### PHP (Laravel)

[](#php-laravel)

```
use Projectmata\MobileOpenVpn\Facades\OpenVpn;

// 1. Prompt the user for VPN permission (Android only — iOS no-ops)
OpenVpn::requestPermission();

// 2. Start a tunnel from an .ovpn profile string
$ovpn = file_get_contents(storage_path('vpn/client.ovpn'));

$result = OpenVpn::connect(
    profile: $ovpn,
    username: 'alice',
    password: $credential,
    displayName: 'Corporate VPN',
);

// 3. Check status
$status = OpenVpn::getStatus();
// ['success' => true, 'status' => 'connected' | 'connecting' | 'disconnected']

// 4. Tear down
OpenVpn::disconnect();
```

### JavaScript (in-app)

[](#javascript-in-app)

The plugin registers itself on `window.NativePHP.OpenVpn`:

```
await window.NativePHP.OpenVpn.RequestPermission();

const result = await window.NativePHP.OpenVpn.Connect({
    profile: ovpnString,
    username: 'alice',
    password: credential,
    displayName: 'Corporate VPN',
});

const { status } = await window.NativePHP.OpenVpn.GetStatus();

await window.NativePHP.OpenVpn.Disconnect();
```

Bridge methods
--------------

[](#bridge-methods)

MethodParamsReturns`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
------------------

[](#native-integration)

### Android

[](#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](https://github.com/schwabe/ics-openvpn) or your chosen runtime into your app, then update `resources/android/src/main/java/com/projectmata/mobileopenvpn/OpenVpnPlugin.kt` `Connect.execute()` to:

1. Parse the `.ovpn` profile via `ConfigParser`.
2. Build a `VpnProfile`.
3. Start `OpenVPNService` with `VPNLaunchHelper.startOpenVpn(profile, context)`.

Also wire an Activity Result callback if your runtime needs to report back once the user grants consent.

### iOS

[](#ios)

Apple does not provide OpenVPN. Add a **Network Extension** target to your Xcode project backed by [`OpenVPNAdapter`](https://github.com/ss-abramchuk/OpenVPNAdapter) (SPM or CocoaPods). In `Connect.execute()`:

1. Create a `NETunnelProviderProtocol` whose `providerBundleIdentifier` matches your NE target.
2. Pass the `.ovpn` bytes, username, and password via `providerConfiguration`.
3. `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
-----------

[](#permissions)

- **Android**: `INTERNET`, `ACCESS_NETWORK_STATE`, `FOREGROUND_SERVICE` are declared by this package. The system additionally shows a VPN consent dialog the first time you call `RequestPermission()`.
- **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
-----------------

[](#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
-------

[](#license)

MIT (scaffold code). The OpenVPN runtime you link against carries its own license — see above.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance91

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5495492f5d4cf3c05ca542a5bbf714e889fdad7a60930fdde6eacf5dfe45151?d=identicon)[ramilojomar2001@gmail.com](/maintainers/ramilojomar2001@gmail.com)

---

Top Contributors

[![jomarmata24](https://avatars.githubusercontent.com/u/64277739?v=4)](https://github.com/jomarmata24 "jomarmata24 (4 commits)")

### Embed Badge

![Health badge](/badges/projectmata-mobile-openvpn/health.svg)

```
[![Health](https://phpackages.com/badges/projectmata-mobile-openvpn/health.svg)](https://phpackages.com/packages/projectmata-mobile-openvpn)
```

###  Alternatives

[yeesoft/yii2-comments

Comments Module For Yii2 Framework

227.8k2](/packages/yeesoft-yii2-comments)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
