• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    JavaScript
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Communicate with a openvpn instance via telnet.

node-openvpn

NPM version Dependency Status npm

Communicate with an OpenVPN client instance via telnet using node.

Installation

$ npm install node-openvpn --save

Usage

const openvpnmanager = require('node-openvpn');

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.connect(opts)

// will be emited on successful interfacing with openvpn instance
openvpn.on('connected', () => {
  openvpnmanager.authorize(auth);
});

// emits console output of openvpn instance as a string
openvpn.on('console-output', output => {
  console.log(output)
});

// emits console output of openvpn state as a array
openvpn.on('state-change', state => {
  console.log(state)
});

// emits console output of openvpn state as a string
openvpn.on('error', error => {
  console.log(error)
});

// get all console logs up to this point
openvpnmanager.getLog(console.log)

// and finally when/if you want to
openvpnmanager.disconnect();

// emits on disconnect
openvpn.on('disconnected', () => {
  // finally destroy the disconnected manager 
  openvpnmanager.destroy()
});

More Repositories

1

netify-jump

Netify Jump is a software-based system that effectively transforms your computer into a WiFi router and/or repeater.
CSS
221
star
2

react-router-redux-rxjs-code-splitting

An example React Redux app using React Router & RxJS for route management & chunk loading respectively.
JavaScript
55
star
3

node-hotspot

Manage, Add & Remove infrastructure mode hotspots on Windows & OSX, WIP: Linux
JavaScript
28
star
4

node-startup-manager

A Cross-platform startup/login manager for node js.
JavaScript
14
star
5

openvpn-bin

Initialize a openvpn instance for mac, windows & linux
JavaScript
6
star
6

photon-media

No longer maintained
JavaScript
5
star
7

sloth-bot

Bot full of fun commands
JavaScript
4
star
8

photon-wallpaper

A clean way of keeping your wallpaper synced with Bing or Reddit subreddits!
JavaScript
4
star
9

yyjbot

Whales, pizzas & various assorted commands.
JavaScript
3
star
10

area51-launcher

JavaScript
2
star
11

B3-Alteradmin

Contains python B3 plugin source & IWEngine GSC
Python
2
star
12

express-template-stream

Express middleware that allows streaming of template literals w/ interpolation of Node.JS streams, Arrays and Promises
JavaScript
1
star
13

Ulterius

CSS
1
star
14

go-deeper

1
star
15

react-router-location-aware-transitions

[WIP] Power contextual location aware react router transitions πŸŽ‰
JavaScript
1
star
16

chatterbox

WIP
JavaScript
1
star
17

UlteriusUI

CSS
1
star
18

hostednetwork.js

Node binding for netsh hostednetwork win32 API
C++
1
star
19

zoneminder-node

Zoneminder Remote API Node.js Client module
JavaScript
1
star
20

emoji-client

Hack Victoria 2016 project
JavaScript
1
star