Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
telnet-openvpn
Advanced tools
Connect to OpenVPN management port through telnet.
$ npm install telnet-openvpn --save
var TelnetVPN = require('telnet-openvpn');
var vpn = new TelnetVPN();
var options = {
host: '127.0.0.1',
port: 1337,
ors: '\r\n',
sendTimeout: 2000
};
var auth = {
username: 'username',
password: 'password'
};
vpn.connect(options);
vpn.on('connect', function() {
vpn.exec('log on all').then(function() {
return vpn.exec('state on').then(function() {
return vpn.exec('hold release').then(function() {
return vpn.authorize(auth);
});
});
}).catch(function(error) {
console.error(error);
});
});
vpn.on('log', function(result) {
console.log(result);
});
vpn.on('error', function(result) {
console.log(result);
vpn.disconnect();
});
vpn.on('end', function(result) {
console.log(result);
vpn.destroy();
});
vpn.on('data', function(result) {
console.log(result);
});
import TelnetVPN from 'telnet-openvpn';
let vpn = new TelnetVPN();
let options = {
host: '127.0.0.1',
port: 1337,
ors: '\r\n',
sendTimeout: 2000
};
let auth = {
username: 'username',
password: 'password'
};
vpn.connect(options);
vpn.on('connect', () => {
vpn.exec('log on all').then(() => {
return vpn.exec('state on').then(() => {
return vpn.exec('hold release').then(() => {
return vpn.authorize(auth);
});
});
}).catch((error) => {
console.error(error);
});
});
vpn.on('log', (result) => {
console.log(result);
});
vpn.on('error', (error) => {
console.log(error);
vpn.disconnect();
});
vpn.on('end', (result) => {
console.log(result);
vpn.destroy();
});
vpn.on('data', (result) => {
console.log(result);
});
Connects to the management port specified in the .ovpn file.
More options can be found in the telnet-client docs.
options:
After user connects, vpn.authorize(auth) must be called if .ovpn file specifies auth-user-pass.
options:
Specify telnet console commands through this function.
EventEmitter options emitted as information is received from telnet console.
events:
Ends telnet session and triggers the 'end' event emitter.
Removes all instances of telnet console socket connection. Used for 'error' event emitter.
Closes telnet session but does not kill all telnet instances like vpn.destroy(). It is possible the server may send some data.
# OpenVPN management IP and port (localhost 1337).
management 127.0.0.1 1337
# OpenVPN wait for hold release from telnet console (vpn.exec('hold release')).
management-hold
# OpenVPN wait for authentication from telnet console (vpn.authorize(auth)).
management-query-passwords
# OpenVPN authenticate using username and password from telnet console.
auth-user-pass
Start OpenVPN through command line (requires OpenVPN) :
$ openvpn myconfig.ovpn
For more OpenVPN management commands please follow OpenVPN's documentation
FAQs
Connect to OpenVPN management port through telnet.
We found that telnet-openvpn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.