Skip to content

Commit 370bf1d

Browse files
author
Kanhaiya Lal Singh
committed
Beta release for new binaries
1 parent 0e1eb46 commit 370bf1d

File tree

7 files changed

+58
-17
lines changed

7 files changed

+58
-17
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ declare module "@lambdatest/node-tunnel" {
2626
class Tunnel {
2727
start(options: Partial<Options>, callback: (error?: Error) => void): void;
2828
isRunning(): boolean;
29-
stop(callback: () => void): void;
29+
stop(callback: (error?: Error, status: boolean) => void): Promise<void>;
3030
}
3131
}
3232

lib/cfg/node-tunnel-config-v3.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"binaryLinks":{"mac":{"32bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/mac/32bit/LT_Mac.zip","binaryName":"LT_Mac.zip","hash":"5fdb3e99e8c20fa9de64c73a3d68bac3"},"64bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/mac/64bit/LT_Mac.zip","binaryName":"LT_Mac.zip","hash":"8bb2c01ca2eef94764523a7c40e72a39"}},"win":{"32bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/windows/32bit/LT_Windows.zip","binaryName":"LT_Windows.zip","hash":"251cedbb4aeaf4f65d0e772073327832"},"64bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/windows/64bit/LT_Windows.zip","binaryName":"LT_Windows.zip","hash":"815260a1d983e79f2a35a732ab178c28"}},"linux":{"32bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/linux/32bit/LT_Linux.zip","binaryName":"LT_Linux.zip","hash":"dfed824375d2e4326034ba8720fb88fd"},"64bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/linux/64bit/LT_Linux.zip","binaryName":"LT_Linux.zip","hash":"7ce7a92c80e5968bbc81e610ad12ed04"}},"freebsd":{"32bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/freebsd/32bit/LT_Freebsd.zip","binaryName":"LT_Freebsd.zip","hash":"03389252446fa9c10afd3784cc8c550e"},"64bit":{"httpPath":"https://downloads.lambdatest.com/tunnel/alpha/freebsd/64bit/LT_Freebsd.zip","binaryName":"LT_Freebsd.zip","hash":"36b42ef31100b8602596ad2eb8b9d0be"}}},"AuthUrl":"https://accounts.lambdatest.com/api/user/token/auth","logEnable":true,"latest":"3.0.0-beta.1","supportedVersions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.0.19","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.1.7","2.1.8","2.1.9","2.1.10","2.1.11","2.1.12","2.1.13","2.1.14","2.1.15","2.1.16","2.1.17","2.1.18","2.1.19","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.2.6","2.2.7","2.2.8","2.2.9","2.2.10","2.2.11","2.2.12","2.2.13","2.2.14","2.2.15","2.2.16","2.2.17","2.2.18","2.2.19","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.3.10","2.3.11","2.3.12","2.3.13","2.3.14","2.3.15","2.3.16","2.3.17","2.3.18","2.3.19","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.8","2.4.9","2.4.10","2.4.11","2.4.12","2.4.13","2.4.14","2.4.15","2.4.16","2.4.17","2.4.18","2.4.19","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.5.10","2.5.11","2.5.12","2.5.13","2.5.14","2.5.15","2.5.16","2.5.17","2.5.18","2.5.19","2.6.0","2.6.1","2.6.2","2.6.3","2.6.4","2.6.5","2.6.6","2.6.7","2.6.8","2.6.9","2.6.10","2.6.11","2.6.12","2.6.13","2.6.14","2.6.15","2.6.16","2.6.17","2.6.18","2.6.19","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.7.5","2.7.6","2.7.7","2.7.8","2.7.9","2.7.10","2.7.11","2.7.12","2.7.13","2.7.14","2.7.15","2.7.16","2.7.17","2.7.18","2.7.19","2.8.0","2.8.1","2.8.2","2.8.3","2.8.4","2.8.5","2.8.6","2.8.7","2.8.8","2.8.9","2.8.10","2.8.11","2.8.12","2.8.13","2.8.14","2.8.15","2.8.16","2.8.17","2.8.18","2.8.19","2.9.0","2.9.1","2.9.2","2.9.3","2.9.4","2.9.5","2.9.6","2.9.7","2.9.8","2.9.9","2.9.10","2.9.11","2.9.12","2.9.13","2.9.14","2.9.15","2.9.16","2.9.17","2.9.18","2.9.19","3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9"]}

lib/conf/node-tunnel-config.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var httpTunnelConfigPath =
2-
'https://s3.amazonaws.com/downloads.lambdatest.com/tunnel/node-tunnel-config.json',
1+
var httpTunnelConfigPath = 'https://downloads.lambdatest.com/tunnel/node-tunnel-config-v3.json',
32
httpTunnelLogUrl = 'https://oinwgsy681.execute-api.us-east-1.amazonaws.com/prod/addLog',
43
https = require('https'),
54
urlParse = require('url'),

lib/tunnel.js

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ function addArguments_(self, fnCallback) {
594594
case 'verbose':
595595
case 'v':
596596
if (value) {
597-
binaryArgs.push('--v');
597+
binaryArgs.push('--verbose');
598598
}
599599
break;
600600

@@ -659,12 +659,55 @@ function addArguments_(self, fnCallback) {
659659
binaryArgs.push(value);
660660
}
661661
break;
662+
662663
case 'controller':
663664
if (value) {
664665
binaryArgs.push('--controller');
665666
binaryArgs.push(value);
666667
}
667668
break;
669+
670+
case 'mitm':
671+
if (value) {
672+
binaryArgs.push('--mitm');
673+
binaryArgs.push(value);
674+
}
675+
break;
676+
677+
case 'ingressonly':
678+
if (value) {
679+
binaryArgs.push('--ingress-only');
680+
binaryArgs.push(value);
681+
}
682+
break;
683+
684+
case 'egressonly':
685+
if (value) {
686+
binaryArgs.push('--egress-only');
687+
binaryArgs.push(value);
688+
}
689+
break;
690+
691+
case 'mode':
692+
if (value) {
693+
binaryArgs.push('mode');
694+
binaryArgs.push(value); // value can only be [ssh,ws], can give error if any other value specified
695+
}
696+
break;
697+
698+
case 'sshconntype':
699+
if (value) {
700+
binaryArgs.push('--sshConnType');
701+
binaryArgs.push(value); // will work only if mode === "ssh", allowed values (over_22, over_443, over_ws), can give error if any other value specified
702+
}
703+
break;
704+
705+
case 'nows':
706+
if (value) {
707+
binaryArgs.push('--nows'); //can give error if mode==="ws"
708+
binaryArgs.push(value);
709+
}
710+
break;
668711
}
669712
}
670713
if (binaryArgs.indexOf('--controller') === -1) {

lib/tunnel_binary.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var localTunnelConfig_ = require('./conf/node-tunnel-config.json'),
1+
var localTunnelConfig_ = require('./cfg/node-tunnel-config-v3.json'),
22
logger,
33
https = require('https'),
44
urlParse = require('url'),
@@ -7,7 +7,8 @@ var localTunnelConfig_ = require('./conf/node-tunnel-config.json'),
77
unzip = require('unzipper'),
88
fs = require('fs'),
99
path = require('path'),
10-
os = require('os');
10+
os = require('os'),
11+
executableName = 'LT';
1112
/**
1213
* TunnelBinary is a function based Class.
1314
*/
@@ -28,16 +29,16 @@ function TunnelBinary(httpTunnelConfig) {
2829
} else {
2930
this.platform = 'linux';
3031
}
31-
this.httpPath = this.httpTunnelConfig.jsonResponse.tunnelBinary[this.platform][
32+
this.httpPath = this.httpTunnelConfig.jsonResponse.binaryLinks[this.platform][
3233
this.bits
33-
].newHttpPath;
34-
this.binaryName = this.httpTunnelConfig.jsonResponse.tunnelBinary[this.platform][
34+
].httpPath;
35+
this.binaryName = this.httpTunnelConfig.jsonResponse.binaryLinks[this.platform][
3536
this.bits
36-
].newBinaryName;
37-
this.httpHashContents = this.httpTunnelConfig.jsonResponse.tunnelBinary[this.platform][
37+
].binaryName;
38+
this.httpHashContents = this.httpTunnelConfig.jsonResponse.binaryLinks[this.platform][
3839
this.bits
3940
].hash;
40-
this.localHashContents = localTunnelConfig_.tunnelBinary[this.platform][this.bits].hash;
41+
this.localHashContents = localTunnelConfig_.binaryLinks[this.platform][this.bits].hash;
4142
logger = this.httpTunnelConfig.logger;
4243

4344
/**
@@ -123,7 +124,6 @@ function TunnelBinary(httpTunnelConfig) {
123124
});
124125
fileStream.on('close', function() {
125126
if (self.checkPath_(binaryPath)) {
126-
var executableName = self.binaryName.split('.')[0];
127127
var unzipBinaryPath = path.join(destParentDir, executableName);
128128
var destBinaryName = executableName;
129129
if (self.windows) {
@@ -197,7 +197,6 @@ function TunnelBinary(httpTunnelConfig) {
197197
this.binaryPath_ = function(conf, fnCallback) {
198198
try {
199199
var destParentDir = this.availableDirs_();
200-
var executableName = this.binaryName.split('.')[0];
201200
var destBinaryName = executableName;
202201
if (this.windows) {
203202
destBinaryName += '.exe';
@@ -214,7 +213,7 @@ function TunnelBinary(httpTunnelConfig) {
214213
} else {
215214
console.log(`Binary is deprecated`);
216215
fs.writeFileSync(
217-
__dirname + '/conf/node-tunnel-config.json',
216+
__dirname + '/cfg/node-tunnel-config-v3.json',
218217
JSON.stringify(this.httpTunnelConfig.jsonResponse)
219218
);
220219
localTunnelConfig_ = this.httpTunnelConfig.jsonResponse;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/node-tunnel",
3-
"version": "2.0.2",
3+
"version": "3.0.0-beta.1",
44
"description": "Nodejs bindings for LambdaTest Tunnel",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)