Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
openvpn-client
Advanced tools
Create an OpenVPN client instance, using "openvpn" command.
$ npm install openvpn-client
OpenVPNClient represents an instance of openvpn running as client It passes the array of options passed to the constructor as arguments to the openvpn command. Apart from that, it supports writing to a temporary authentication file that is then passed as --auth-user-pass argument.
The class is not exposed publicly, but instantiated through other exported functions.
function (buffer)
When data are received from the server.
function ()
When connection to server is initialized successfully.
function (exitCode)
When connection to server is closed.
Argument: vpnOpts The arguments passed to openvpn command.
Pass a username and password to use as authentication.
If this function is used, then the --auth-user-pass argument is added automatically.
parameters:
Start OpenVPN process.
It returns a Promise that is fulfilled when "Inititialization Sequence Completed" message is received from the server.
Instead of promises you can use callbacks by passing a callback function.
parameters:
# Kill the OpenVPN process.
disconnect: ->
new Promise (resolve, reject) =>
@proc.kill()
@proc.on 'exit', ->
resolve()
Default array of options. Any options passed to subsequent functions are merged with this array.
Create an openvpn client.
Create an OpenVPNClient that connects immediately, and return a disposer that disconnects the client.
It will setup authentication based on the first parameter, and it will return a disposer that when cleaned up disconnects the process. Use this function when a connection is needed for a specific period of time.
Use it in combination with bluebird's resource management through Promise.using function.
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning.
The project is licensed under the MIT license.
FAQs
Create OpenVPN client instances.
The npm package openvpn-client receives a total of 47 weekly downloads. As such, openvpn-client popularity was classified as not popular.
We found that openvpn-client 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.