npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openconnectclient

v1.0.1

Published

Handle Cisco SSL VPNs with OpenConnect

Downloads

1

Readme

Openconnect Client

This projected is forked from openconnect which is not maintained anymore by its developer.

Usage

There are developed four simple functions which we describe them respectively.

available()

Check if openconnect is installed on your system or not, if it is installed it will return the information about version and path to installed program and throws an error otherwise.
Example:

    try{
        let result = await available();
        /*
        *   result = {
        *    openConnect: '/usr/bin/openconnect',
        *   version: 'OpenConnect version v9.01'
        *   }
        */
    }catch(err){
        //Error handling
    }

connect(config)

  • config: an object with following type:
    {
        password:       string,
        server:         string,
        otherParam:     value
    }

otherParam is some other parameters which you wish to pass to openconnect in commandline. It means otherParam is used as following form:

    $ openconnect --otherParam = value

NOTE: You can use otherParam to pass username, e.g.

    {
        password:       'secret',
        server:         'xxxxx.com:443',
        user:           'username'
    }

disconnect()

Break provious connection and disconnect you from server.
Example:

    try{
        let result = await disconnect();
        /*
        *   result contains `exit code`
        */
    }catch(err){
        //Error handling
    }

establishment(level)

  • level: Level of connection

Using this method you can determine what you mean by a successful connection!
Usually there are three step to connect to the server:

  1. Connection establishment by receiveing 200 status code.
  2. CSTP connection.
  3. DTLS connection.

A connection is considered secure when all three above steps are passed but may have a server which don't do all of above step. In that case you need to change level of establishment and tell this module, when a connection is considered as sucessful.

level is one of the following strings: 'CONNECTED', 'CSTP' and 'DTLS' which are respectively corresponding to mentioned steps.

NOTE: Default level is DTLS connection which is the most secure state of connection.

What's new?

There were some problems with original module! e.g. The failure scenario was considered just when you see following message in output:

Login failed

But we know this is not just the case when we face failure, there are some scenarios when we come across failure and if we don't handle them correctly, it will cause main program to abort.

Another problem with original module is that it recognize successful scenarios just when you see following message in output:

Established DTLS connection

In some servers, you can connect to the server and get IP address but DTLS connection is not available.
In this module we provided a way to define what you mean by successful connection.

Some other minor changes are applied to this project but we don't mention them here.

Platform

This project is developd based on openconnect and hence it only works if you are installed this program.

It is tested on Manjaro and works correctly but about other platfroms: if openconnect is available, this module should work correctly too.

License

MIT