UNPKG

node-vpn-client

Version:

Controls a instance of OpenVpn Client through the manager interface

27 lines 795 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const main_1 = require("./main"); const vpnClient = new main_1.default({ sudoPasswd: 'sudo pass', ovpnFiles: ['/test.ovpn'], vpnUsername: 'vpnusername', vpnPasswd: 'vpnpassword', onDisconnected: () => { console.log('disconnected'); }, timeout: 50 }); const start = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { try { const ip = yield vpnClient.connect(); console.log('connected. external ip address is:'); console.log(ip); } catch (err) { console.log('error connecting to vpn, try again'); start(); } }); start(); //# sourceMappingURL=example.js.map