mirror of
https://github.com/calmh/node-vpnc.git
synced 2026-07-17 01:35:06 +00:00
[UNMAINTAINED] Cisco VPN connector / vpnc wrapper
- JavaScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| lib | ||
| test | ||
| .gitignore | ||
| .travis.yml | ||
| example.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
This project is not actively maintained
Issues and pull requests on this repository may not be acted on in a timely manner, or at all. You are of course welcome to use it anyway. You are even more welcome to fork it and maintain the results.
node-vpnc
Use vpnc to connect to a remote Cisco VPN, using a specified configuration.
Example
var vpnc = require('vpnc');
var config = {
IPSec_ID: 'foobar',
IPSec_gateway: 'vpn.example.com',
IPSec_secret: 'topSecret',
Xauth_username: 'test@example',
Xauth_password: 'r00barb',
IKE_Authmode: 'psk',
IKE_DH_Group: 'dh2',
DNSUpdate: 'no',
NAT_Traversal_Mode: 'force-natt',
Local_Port: 0,
Cisco_UDP_Encapsulation_Port: 0,
};
vpnc.available(function (err, version) {
if (err) {
console.log('VPN unavailable:');
console.log(err);
} else {
console.log('Found ' + version);
connect();
}
});
function connect() {
vpnc.connect(config, function (err, code) {
if (err) {
console.log('Error connecting VPN:');
console.log(err);
} else {
console.log('VPN connected. Disconnecting in five seconds.');
setTimeout(disconnect, 5000);
}
});
}
function disconnect() {
vpnc.disconnect(function (err, code) {
if (err) {
console.log('Error disconnecting VPN:');
console.log(err);
} else {
console.log('VPN disconnected.');
}
});
}
License
MIT

