luigiplr / node-openvpn

Communicate with a openvpn instance via telnet.
131 stars 26 forks source link

How to use .ovpn file in windows using node-openvpn #11

Open wolvorine1933 opened 6 years ago

wolvorine1933 commented 6 years ago

var openvpnmanager = require('node-openvpn') var openvpnBin = require('openvpn-bin') var path = require('path')

openvpnBin.initialize('C:/Program Files/OpenVPN/bin/openvpn.exe', { host: '127.0.0.1', port: 1337, config: path.normalize('C:/Users/toshiba/Desktop/client.ovpn') }).then(function() { var managerInstance = openvpnmanager.connect({ host: '127.0.0.1', port: 1337 })

managerInstance.on('connected', function() { managerInstance.authorize({ user: '', pass: '' }) })

managerInstance.on('console-output', function(output) { console.log(output) }) })