node-openvpn
Communicate with an OpenVPN client instance via telnet using node.
Installation
$ npm install node-openvpn --save
Usage
const openvpnmanager = ; const opts = host: '127.0.0.1' // normally '127.0.0.1', will default to if undefined port: 1337 //port openvpn management console timeout: 1500 //timeout for connection - optional, will default to 1500ms if undefined logpath: 'log.txt' //optional write openvpn console output to file, can be relative path or absolute;const auth = user: 'vpnUserName' pass: 'vpnPassword';const openvpn = openvpnmanager // will be emited on successful interfacing with openvpn instanceopenvpn; // emits console output of openvpn instance as a stringopenvpn; // emits console output of openvpn state as a arrayopenvpn; // emits console output of openvpn state as a stringopenvpn; // get all console logs up to this pointopenvpnmanager // and finally when/if you want toopenvpnmanager; // emits on disconnectopenvpn;