Lambda Tunnel helps in establishing an SSH connection between your local machine and our cloud servers to help you perform tests on locally hosted websites and web-apps. With Lambda Tunnel, you can ensure how robust your website rendering is across 2000+ real browsers, even before you make it live on the internet.
If due to some unfortunate reason, you are unable to perform cross browser testing using Lambda Tunnel then this document will help you troubleshoot the most common challenges.
Oops !! Facing issue while testing your locally hosted application through Lambda tunnel? Here are a few guidelines for you.
Before proceeding, here are some of the common issues:
After configuring the tunnel, you might get into the error similar to the below screenshot:
The error “localhost refused to connect” occurs because of using the URL as localhost which is unfortunately not compatible with various browsers and browser versions. We are deliberately eliminating the URL localhost and recovering it with localhost.lambdatest.com or your local system IP.
For example you might find above error with URL:https://localhost/demo.html
however, URL:https://localhost.lambdatest.com/demo.html or 10.0.0.15/demo.html would definitely work fine for you.
While testing an application hosted on your local machine, you may receive an “Invalid Host Header” error message when testing on LambdaTest using a local connection. This error is most commonly caused by a misconfiguration of the application server that causes it to reject non-local connections or reject requests directed at hostnames other than localhost(or any custom one set)
Since, web applications are now built with various different kinds of frameworks like angular, react etc; In order to test it using tunnel the command used to run your web app needs to modified in your project manifest file i.e. “package.json”
To resolve this, here is the quick small solution for you. While running your application, you can either use command
ng serve --host 0.0.0.0 --disable-host-check or set your start configuration in package.json file as
“ng serve --host 0.0.0.0 --disable-host-check” instead of changing your running command.
HOST=< hostname >, once you are done with it, now you can add your localhost IP along with your hostname in your system hosts file.
127.0.0.1 < hostname >
While testing your local web app built through WordPress, you may find issue with the rendering of CSS, similar to the below screenshot:
The general solution for this is to update the WordPress Address and Site Address on the General Settings tab in the WordPress dashboard with your system IP address rather than the default of localhost, then everything will be emitted relative to that. Here is a screenshot for your further reference:
By applying the above changes, you would find the CSS loading issue as resolved. Below is a screenshot after the mentioned changed:
If you are testing a server that requires IP whitelisting, then you just have to set up a Local Testing connection and whitelist the below few IP’s :
However be advised, as we are aggressively adding more and more data centers, these IP would changed, you can see the updated IP’s on this documentation as well.
Lambda tunnel binary is developed in a way that when starting, it tries to free port starting from 9090 till 9094 sequentially and if it doesn’t seem to find any free PORTS, then it would throw an error “No available Port found for 5 attempts”.
The reason behind this error is either your system has 5 active tunnels running simultaneously or the PORTS that tunnel is trying to find is already in use by another running application.
In such a scenario, it is suggested to append “-tunnelProxyPort
LT -user < username > -key < accessKey > -tunnelProxyPort < portNo >
Because of some firewall restrictions, your web application might not be accessible on some other servers even after whitelisting the IP’s and configuring the tunnel, in such case you need to make an entry in the hosts file which is used to map hostnames to IP addresses. With the hosts file, you can change the IP address that you resolve a given domain name. This change only affects your own computer without affecting how the domain is resolved worldwide.
This is particularly useful when you wish to see how a website will look like when hosted on a different server without making any DNS changes to your domain.
The location of the hosts file, depending on the operating system that you are using, is:
Let’s say that you wish to resolve mydomain.com to the IP address 10.20.30.40. In this case, you would need to open up the hosts file with a text editor and append the following line:
10.20.30.40 mydomain.com www.mydomain.com
We have upgraded our tunnel with CUI(Console UI). The CUI will help you present detailed information inside your cmd/terminal console to help you understand what is going wrong with the SSH connection. Below is a screenshot of CUI.
These logs will be updated realtime with respect to your SSH connection established through Lambda Tunnel. For instance, if you are facing issues with your internet provider then it may result in crashing your binary file. In such cases, you will get below logs generated in the CUI.
Port 443 is used for secure web browser communication. Web servers offering to accept and establish secure connections listen on this port for connections from web browsers desiring strong communication security.
Port 443 is a standard Port for routing traffic to ltuns.lambdatest.com, however, if this port is unable to establish a secure shell tunnel connection, you might receive a error message shown in below screenshot.
In such case, you can switch to Port 22 which is a default SSH Port and is used for Secure Shell (SSH) communication and allows remote administration access to the VM. For switching to Port 22 from Port 443, you can append
-customSSHPort 22 to your usual tunnel command.