Gathering detailed insights and metrics for @lambdatest/node-tunnel
Gathering detailed insights and metrics for @lambdatest/node-tunnel
Gathering detailed insights and metrics for @lambdatest/node-tunnel
Gathering detailed insights and metrics for @lambdatest/node-tunnel
npm install @lambdatest/node-tunnel
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
11 Stars
207 Commits
16 Forks
12 Watching
8 Branches
25 Contributors
Updated on 10 May 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
10.4%
15,267
Compared to previous day
Last week
31.1%
100,992
Compared to previous week
Last month
-1.6%
362,887
Compared to previous month
Last year
63.7%
3,354,747
Compared to previous year
npm i @lambdatest/node-tunnel
1var lambdaTunnel = require('@lambdatest/node-tunnel'); 2 3//Creates an instance of Tunnel 4var tunnelInstance = new lambdaTunnel(); 5 6// Replace <lambdatest-user> with your user and <lambdatest-accesskey> with your key. 7var tunnelArguments = { 8 user: process.env.LT_USERNAME || '<lambdatest-user>', 9 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>' 10}; 11 12// Callback Style 13// Atarts the Tunnel instance with the required arguments 14tunnelInstance.start(tunnelArguments, function(error, status) { 15 if (!error) { 16 console.log('Tunnel is Running Successfully'); 17 } 18}); 19 20// Promise Style 21tunnelInstance 22 .start(tunnelArguments) 23 .then(status => { 24 console.log('Tunnel is Running Successfully'); 25 }) 26 .catch(error => { 27 console.log(error); 28 }); 29 30// Async/Await Style 31(async function() { 32 try { 33 const istunnelStarted = await tunnelInstance.start(tunnelArguments); 34 console.log('Tunnel is Running Successfully'); 35 } catch (error) { 36 console.log(error); 37 } 38})();
Start tunnel Instance.
tunnelArguments
: credentials for secure tunnel connection.
user
: The username for the LambdaTest account.key
: The accessKey for the LambdaTest account.callback
(function(error, status)
): A callback to invoke when the API call is
complete.1// Callback Style 2tunnelInstance.start(tunnelArguments, function(error, status) { 3 if (!error) { 4 console.log('Tunnel is Running Successfully'); 5 } 6}); 7 8// Promise Style 9tunnelInstance 10 .start(tunnelArguments) 11 .then(status => { 12 console.log('Tunnel is Running Successfully'); 13 }) 14 .catch(error => { 15 console.log(error); 16 }); 17 18// Async/Await Style 19(async function() { 20 try { 21 const istunnelStarted = await tunnelInstance.start(tunnelArguments); 22 console.log('Tunnel is Running Successfully'); 23 } catch (error) { 24 console.log(error); 25 } 26})();
Get Status of tunnel Instance.
1// Callback Style 2tunnelInstance.start(tunnelArguments, function(error, status) { 3 if (!error) { 4 console.log('Tunnel is Running Successfully'); 5 var tunnelRunningStatus = tunnelInstance.isRunning(); 6 console.log('Tunnel is Running ? ' + tunnelRunningStatus); 7 } 8}); 9 10// Promise Style 11tunnelInstance 12 .start(tunnelArguments) 13 .then(status => { 14 console.log('Tunnel is Running Successfully'); 15 const tunnelRunningStatus = tunnelInstance.isRunning(); 16 console.log('Tunnel is Running ? ' + tunnelRunningStatus); 17 }) 18 .catch(error => { 19 console.log(error); 20 }); 21 22// Async/Await Style 23(async function() { 24 try { 25 const istunnelStarted = await tunnelInstance.start(tunnelArguments); 26 console.log('Tunnel is Running Successfully'); 27 const tunnelRunningStatus = tunnelInstance.isRunning(); 28 console.log('Tunnel is Running ? ' + tunnelRunningStatus); 29 } catch (error) { 30 console.log(error); 31 } 32})();
Get name of the Running tunnel Instance.
callback
(function(tunnelName)
): A callback to invoke when the API call is
complete.1// Callback Style 2tunnelInstance.start(tunnelArguments, function(error, status) { 3 if (!error) { 4 console.log('Tunnel is Running Successfully'); 5 tunnelInstance.getTunnelName(function(tunnelName) { 6 console.log('Tunnel Name : ' + tunnelName); 7 }); 8 } 9}); 10 11// Promise Style 12tunnelInstance 13 .start(tunnelArguments) 14 .then(status => { 15 console.log('Tunnel is Running Successfully'); 16 tunnelInstance.getTunnelName().then(tunnelName => { 17 console.log('Tunnel Name : ' + tunnelName); 18 }); 19 }) 20 .catch(error => { 21 console.log(error); 22 }); 23 24// Async/Await Style 25(async function() { 26 try { 27 const istunnelStarted = await tunnelInstance.start(tunnelArguments); 28 console.log('Tunnel is Running Successfully'); 29 const tunnelName = await tunnelInstance.getTunnelName(); 30 console.log('Tunnel Name : ' + tunnelName); 31 } catch (error) { 32 console.log(error); 33 } 34})();
Stop the Running tunnel Instance.
callback
(function(error, status)
): A callback to invoke when the API call is
complete.1// Callback Style 2tunnelInstance.start(tunnelArguments, function(error, status) { 3 if (!error) { 4 console.log('Tunnel is Running Successfully'); 5 tunnelInstance.stop(function(error, status) { 6 console.log('Tunnel is Stopped ? ' + status); 7 }); 8 } 9}); 10 11// Promise Style 12tunnelInstance 13 .start(tunnelArguments) 14 .then(status => { 15 console.log('Tunnel is Running Successfully'); 16 tunnelInstance.stop().then(status => { 17 console.log('Tunnel is Stopped ? ' + status); 18 }); 19 }) 20 .catch(error => { 21 console.log(error); 22 }); 23 24// Async/Await Style 25(async function() { 26 try { 27 const istunnelStarted = await tunnelInstance.start(tunnelArguments); 28 console.log('Tunnel is Running Successfully'); 29 const status = await tunnelInstance.stop(); 30 console.log('Tunnel is Stopped ? ' + status); 31 } catch (error) { 32 console.log(error); 33 } 34})();
Every modifier except user and key is optional. Visit LambdaTest tunnel modifiers for an entire list of modifiers. Below are demonstration of some modifiers for your reference.
Below credentials will be used to perform basic authentication of your LambdaTest account.
If you wish to connect tunnel on a specific port.
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 port: '<port>' 5};
If you wish to perform tunnel testing using a proxy.
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 proxyHost: '127.0.0.1', 5 proxyPort: '8000', 6 proxyUser: 'user', 7 proxyPass: 'password' 8};
Human readable tunnel identifier
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 tunnelName: '<your-tunnel-name>' 5};
Populate the path of the local folder you want to test in your internal server as a value in the below modifier.
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 dir: '<path of the local folder you want to test>' 5};
To log every request to stdout.
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 v: true 5};
Logfile You can provide a specific path to this file. If you won't provide a path then the logs would be saved in your present working directory by the filename: tunnel.log. For providing a specific path use the below argument:
1tunnelArguments = { 2 user: process.env.LT_USERNAME || '<lambdatest-user>', 3 key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>', 4 logFile: '/lambdatest/logs.txt' 5};
Our GitHub Issue Tracker will help you log bug reports.
Tips for submitting an issue: Keep in mind, you don't end up submitting two issues with the same information. Make sure you add a unique input in every issue that you submit. You could also provide a "+1" value in the comments.
Always provide the steps to reproduce before you submit a bug. Provide the environment details where you received the issue i.e. Browser Name, Browser Version, Operating System, Screen Resolution and more. Describe the situation that led to your encounter with bug. Describe the expected output, and the actual output precisely.
We don't want to pull breaks in case you want to customize your LambdaTest experience. Before you proceed with implementing pull requests, keep in mind the following. Make sure you stick to coding conventions. Once you include tests, ensure that they all pass. Make sure to clean up your Git history, prior your submission of a pull-request. You can do so by using the interactive rebase command for committing and squashing, simultaneously with minor changes + fixes into the corresponding commits.
LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
3 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More