OpenVPN Connect
OpenVPN Connect is OpenVPN's official VPN client. Protocol Launcher allows you to generate OpenVPN Connect URL scheme links.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
Notes
OpenVPN's Access Server token URL documentation defines a token URL as an HTTPS URL with an authentication token for a connection profile. To trigger the OpenVPN Connect import process, the token URL is prefixed with openvpn://import-profile/. These helpers accept the raw https:// token URL and add exactly that prefix.
The official docs require Access Server 2.11.0 or newer and OpenVPN Connect 3.3.6 or newer for this client import process. The OpenVPN Connect FAQ also says the app installs openvpn:// and openvpn-connect:// URL schemes for installation detection, but it does not document an action format for openvpn-connect://. This module therefore only exposes the documented token URL import format.
Use placeholders in examples and tests. Do not publish real token URLs, credentials, server names, or profile tokens.
Import Profile
import { importProfile } from 'protocol-launcher/openvpn-connect'
const url = importProfile({
url: 'https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN',
})Import Profile Token URL
import { importProfileTokenUrl } from 'protocol-launcher/openvpn-connect'
const url = importProfileTokenUrl({
url: 'https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN',
})Generated URLs
importProfile({
url: 'https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN',
})
// => 'openvpn://import-profile/https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN'
importProfileTokenUrl({
url: 'https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN',
})
// => 'openvpn://import-profile/https://vpn.example.com/rest/GetProfileViaToken?token=REPLACE_WITH_TOKEN'