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, let’s categorized the common issues:
The most common reason why users are not able to configure the tunnel is because of blocked PORT 22 on their network. Since the standard TCP port for SSH is 22, it is mandatory to keep PORT 22 unblocked in order to connect your local system with LambdaTest servers via SSH based integration tunnel.
If your PORT 22 is blocked, you would get the logs on the terminal/cmd similar to the logs showed in below screenshot:
So, the question that arises here is, how you can check if your network PORT 22 is actually blocked?
Here is the single common OS command for you to check:
telnet ltuns.lambdatest.com 22
For more further details regarding this, you can direct to the link.
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