Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The openvpn object can be used to connect players and servers through a VPN, without making them accessible to everyone. 

openvpn IDL

Code Block
languagejs
interface OpenVpnConfig {
    attribute String archiveFile;
    attribute String? obfuscatedSecret;
};

interface OpenVpn {
    Promise<void> installAndRun(OpenVpnConfig config);
    Promise<void> uninstall();
};
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px


Object Creation

Code Block
languagejs
var openvpn = require('@brightsign/openvpn');
var ovpn = new openvpn();

OpenVpn

installAndRun()
Code Block
languagejs
Promise<void> installAndRun(params: OpenVpnParams)

Install the configuration and run OpenVPN.

uninstall()
Code Block
languagejs
Promise<void> uninstall()

Stop and uninstall the configuration

OpenVpnConfig

  • archiveFile string:    Path to the configuration zip

  • obfuscatedSecret string: Encrypted passphrase for protected certificates

Example

This example sends logs to the SD card, but /storage/flash can also be used. Each method has a limitation: If you use an SD card location, you cannot remove the card while the OpenVPN client is active or you will get an error log and the card can be corrupted, while /storage/flash may not be available depending on the player that you are using.

Code Block
languagejs
var openvpn = require('@brightsign/openvpn');
var ovpn = new openvpn();

var params = {
   archiveFile: '/storage/sd/openvpn.zip'
};
ovpn.installAndRun(params)
.then(function() {
   console.log('success');
})
.catch(function(err){
   console.log('err: ' + JSON.stringify(err));
});
ovpn.uninstall()
.then(function() {
   console.log('success');
})
.catch(function(err){
   console.log('err: ' + JSON.stringify(err));
});