Using Local Testing with Live

A usage guide to test websites hosted on localhost, staging and private environments.

Test localhost websites

Once you’ve enabled Local Testing, start a Live session, and enter the website address in the remote browser’s address bar (for instance, localhost:3000). Browse as you would on your own device.

Note: Due to security restrictions in Safari (on iOS 10 and above), localhost URLs will automatically change to http://bs-local.com. This lets us load your website assets properly. Remember to ensure that your local server is configured to serve requests from bs-local.com

Test websites hosted on private or internal servers

You can securely test websites hosted on private or internal servers on our remote browsers and devices with Local Testing. To enable this, follow the steps below:

Start a Live session. In the toolbar dock, click on the Local Testing icon and check Resolve all URLs through my network option. This option ensures that all the requests on our remote browsers and devices are routed through your device.

Resolve all URLs through my network option

Establish the Local Testing connection with a --force-local flag. This ensures that all the requests on our remote browsers and devices are routed through your device.

BrowserStackLocal --key YOUR_ACCESS_KEY --force-local

Learn more about enabling Local Testing with the Local binary

Website Loading Errors

Warning: Currently localhost is not supported on iOS (iPhone & iPad) Chrome browsers. Inorder to test your localhost website on iOS Chrome please replace localhost with bs-local.com. For e.g. Instead of using localhost:3000, please use bs-local.com:3000

In case you are not on iOS Chrome and see the local error page when trying to access a private website in a BrowserStack Live session, there is a possibility that you are behind network restrictions such as a proxy, firewall or a VPN.

Local Error Page

If the local indicator is red, then please ensure that you have the Local Desktop Application installed and connected as per above instructions. If the local indiicator is green and you still see the error page, then there might be network restrictions on your website under test. You can try solve them by using the below listed guides on testing websites behind proxy, firewall or VPN.

If the test website is behind a proxy

In case your test website is behind a proxy, you can just add the configuration to the “Local Connection Dashboard”. Please follow this guide to learn how to test websites in environments behind one (or more) proxies

If the test website is behind a firewall or VPN

In case your test website is behind a firewall or VPN with IP restrictions, try enabling force local. Please follow this guide to learn how to test websites hosted on environments behind a firewall or VPN]

Test local HTTPS websites

You can test local websites with SSL certificates on our remote browsers and devices through Local Testing.

Once you’ve enabled Local Testing, start a Live session and enter the website address in the remote browser’s address bar (for instance: https://localhost:3000 or https://staging.example.com). Browse as you would on your own machine.

Note: Custom/self-signed SSL certificates cannot be installed on remote browsers and devices. So when you request local websites with a custom SSL certificate, the remote browsers will show a security warning. You can manually bypass it and proceed with your testing.

Test assets served from multiple internal (or public) servers

You can test local websites with assets on multiple internal or public servers, with Local Testing. For example, staging.example.com could have content hosted on assets1.staging.example.com, certain public servers, and assets2.staging.example.com.

Once you’ve enabled Local Testing, the content will render as expected - no changes required. Just enter the website address in the remote browser’s address bar and browse as you would on your own machine. There’s no additional setup required.

Test HTML design folders

You can test your HTML files on BrowserStack, without first hosting them internally or locally with Local Testing.

Warning: This feature is currently not supported through the Local Desktop app on Windows & macOS. So, you’ll have to use the Local binary to use this feature. Learn more about using the Local binary (by selecting Other Browsers).

To enable Folder Testing, you’ll need to establish the Local Testing connection with an added –folder flag, along with the absolute path of your HTML file.

Command Line
BrowserStackLocal --key YOUR_ACCESS_KEY --folder <absolute_path_to_html_file>

After enabling Folder testing, you’ll need your account’s Local Folder URL. Your Local Folder URL will be formatted as http://YOUR_USERNAME.browserstack.com. This Local Folder URL can only be accessed by BrowserStack remote machines.

You can also find your account’s Local Folder URL by following the steps below:

  1. Log in to BrowserStack and go to your account settings.
  2. Find “Local Folder URL” on the settings page and copy it.
  3. Back in your Live session, paste the Local Folder URL in the remote browser’s address bar.

Next Steps

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert