Lambda Tunnel For Corporate Firewalls/ Enterprise Restricted Environments

Lambda Tunnel feature allows you to test your private server URLs or locally hosted web-apps or websites on 2000+ real browsers through LambdaTest. However, sometimes corporate firewalls and proxy settings may have restricted you to leverage the Lambda Tunnel binary. Not anymore though, as we’ve come up with a new binary for Lambda Tunnel. Lambda Tunnel follows various protocols such as Web Socket, HTTPS, SSH(Secure Shell), etc. to help you establish a secure and unique tunnel connection between your system and LambdaTest cloud servers.

You can download the Lambda Tunnel binary that will help you establish a secure connection through corporate firewalls between your computer and LambdaTest cloud servers for a testing locally hosted website or web-applications. You can test plain HTML, CSS, PHP, Python, or other similar web files saved on your local system, over combinations of operating systems, browsers, and screen resolutions that are available on LambdaTest.

Windows
macOS
Linux
FreeBSD

Executing Lambda Tunnel for Client Connection


After you download the zip file for your operating system, extract it in a folder and open you command line there. Once you have your terminal routed to the correct directory where the Lambda Tunnel binary file is placed, you need to execute the below command.

LT --user {Your Registered Email ID} --key {Your LambdaTest Access Key} --tunnelName {any random string}

So for example, if your details are as below:

  • Email: example@lambdatest.com
  • LambdaTest Access Key: 123asd123
  • Tunnel Name: SampleTunnel

Then your command would be:

LT --user example@lambdatest.com --key 123asd123 --tunnelName SampleTunnel

Once you execute the command, you will successfully establish a client connection using the Lambda Tunnel. You will find the command logs to state, that you are now ready to test.

What Makes The New Lambda Tunnel Binary Special?


Well, other than the fact that you can now establish a connection through your corporate firewalls with the new Lambda Tunnel binary. Here are a couple things to top it off.

Auto Update Functionality


Earlier, for every version update in out Lambda Tunnel, you were compelled to download the latest binary from our platform and over write it over the outdated version in your computer. Well, now this new binary will take care of that. Everytime you execute this binary, it will check for the latest version available and will update itself automatically, in case it gets outdated.

Default Port 443


Now, by default, everything will run over the port 443 to ensure a secure web browser communication through http protocol over TLS/SSL.

Leverage .lt.yaml file


With this new Lambda Tunnel binary, you can declare your LambdaTest authentication credentials in a YAML file configuration and keep it in the same directory as the LT binary file. That way, you won’t have to pass the environment variables in the cmd every time you wish to configure the Lambda Tunnel. Once you specify these variables in the .lt.yaml file, you will just have to execute the binary file through cmd LT.exe and the YAML file will automatically configure a secure Lambda Tunnel connection by auto detecting the variables specified in the YAML file.

Here is an example of the .lt.yaml file.

User: salmank
Key: 123456789abcdefghijklmnopqrstuv
TunnelName: LambdaTest

Note: You will need to replace this file with your credentials and it has to be named exactly “.lt.yaml“. Once you specify the proxy information as environment variable, it gets auto detected.

Similarly, you can go ahead and pass any other variables by just specifying them in the YAML file. For example, if you wish to have verbose variable passed on for detailed logs while the binary is being configured. You will add the verbose flag in your YAML file:

User: salmank
Key: 123456789abcdefghijklmnopqrstuv
TunnelName: LambdaTest
Verbose: True

Now, when you trigger the binary file through cmd. You will have your verbose logs populated automatically, without you having to specify the variable every time.

Local Testing By MITM (Man-In-The-Middle)


The MITM(Man-in-the-middle) mode enables you to test websites using self-signed certificates on your local system or internal network. It happens very often that you may try to test a website on the localhost which may not have valid SSL certificates before the website is made live. In such cases, you may receive the below error.

You can test such websites by leveraging the MITM mode. The command will look like this:

LT --user salmank@lambdatest.com --key 123456789abcdefghijklmnopqrstuv --tunnelName LambdaTest --mitm

Here is a screenshot of the same website that was throwing an error earlier but can now be tested by running the MITM mode.

Using The Tunnel InfoAPIs


By using the tunnel Info APIs, you can fetch the current status of the tunnel and can use it to stop the tunnel. You can fetch the current tunnel status using the Info API on the tunnel. Suppose the InfoAPI is available on the host over port 8000, then use the below command to infuse the InfoAPI in the tunnel.

LT --user salmank@lambdatest.com --key 123456789abcdefghijklmnopqrstuv --tunnelName LambdaTest --infoAPIPort 8000

In order to fetch the current tunnel status, execute the below command:

curl http://127.0.0.1:8000/api/v1.0/info

To stop the current tunnel, execute the below command:

curl -X DELETE http://127.0.0.1:8000/api/v1.0/stop

Tunnel Arguments


You can find all the arguments for LambdaTest Tunnel by running the below command in your command line:

LT --help

Note: For all modifiers/arguments, refer to the list of Lambda Tunnel Modifiers

2 Likes