Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ngrok2
Advanced tools
Readme
Project is under construction
##Description ngrok package contains two main classes : NgrokCLI - command line wrapper and NgrokAPI - HTTP API wrapper. ngrok function returns Promise, which returns object with wrappers for both APIs :
{
api : 'instance of NgrokAPI,'
cli : 'instance of NgrokCLI' //extends EventEmiter
}
but also it contains NgrokAPI and NgrokCLI constructors (see below how to get them)
###NgrokCLI events :
NgrokCLI constructor accepts two optional arguments : authtoken and configPath [default is $HOME/.node-ngrok.yml]. It's instance has only two public methods :
###NgrokAPI methods:
NgrokAPI constructor accepts one required argument : address [like http://127.0.0.1:4040]
getTunnel and stopTunnel add small delay (100ms) to "queue", therefore getTunnel and getTunnels will wait for a while. This behavior is caused by the fact that ngrok can't return updated tunnels list immediatly.
##Usage:
var ngrok = require('ngrok2');
ngrok(config).then(function (ng) {
ng.api.addTunnel({proto: 'tcp', addr: '22', name: 'ssh'}).then(function (tunnel) {
debug('tunnel added', tunnel);
ng.api.getTunnels().then(function (tunnels) {
debug('these tunnels now exists', tunnels);
ng.api.stopTunnel('ssh').then(function (tunnels) {
debug('these tunnels still work', tunnels);
});
});
});
});
//or:
var NgrokCLI = ngrok.NgrokCLI;
var NgrokAPI = ngrok.NgrokAPI;
//do all your magic with these classes directly
###Config example
{
"authtoken": "YOUR_TOKEN",
"compress_conn": false,
"http_proxy": false,
"inspect_db_size": 50000000,
"metadata": "",
"root_cas": "trusted",
"socks5_proxy": "",
"update": true,
"update_channel": "stable",
"web_addr": "127.0.0.1:4040"
}
For more information go here
Run with debug:
DEBUG=cli-log,cli-event,api,index node myAwesomeScript.js
#or
DEBUG=* node myAwesomeScript.js
License: MIT License
FAQs
Node.js wrapper for ngrok v2.x
The npm package ngrok2 receives a total of 0 weekly downloads. As such, ngrok2 popularity was classified as not popular.
We found that ngrok2 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
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.