<aside> ℹ️ This guide assumes you're trying to test 'localhost' websites via Safari browser on iOS devices.

</aside>

Your 'localhost' website works perfectly fine on your local machine but fails to load/resolve on iOS devices offered on BrowserStack? If yes, read on to find out how you can get this working!

Why is this happening?

Apple and Safari have known restrictions around testing 'localhost' websites on macOS/iOS platforms. Due to these restrictions, we have had to implement modifications on our platform to facilitate the above.

Reasons for failure

We offer a wide range of iOS devices and iOS versions on BrowserStack. We can broadly categorize the errors you may face when testing 'localhost' websites as follows:

1. Your 'localhost' website is hosted on an unsupported port

What ports can I use to test development environments or private servers using BrowserStack?

2. Your 'localhost' website fails to load due to a redirection to 'bs-local.com'

Solutions

1. Resolving the unsupported port issue

This should be fairly simple. You can simply host your local development server on any one of the supported ports mentioned in the link shared above and you should be good to go.

2. Resolving the bs-local.com redirection issue