How to Access Localhost on Mobile Browsers?
If you are working on some projects or on websites or web applications and wanted to take its look on mobile, if yes then please read these articles full it will help you a lot in the development. If you want to run your application in mobile browsers without much trouble, then read these articles till the end. Yes, of course, you can use your chrome inspect tools for that which you can find on right-click on chrome browsers and then choose device toggle toolbar. For better learning about chrome, dev-tools learn from here Chrome Inspect Element Tool & Shortcut.
In this article, we’ll learn viewing your applications on mobile devices which is extremely easy and helpful.
Step 1: Start your applications in a local machine. Before you begin you have to start your application in your browser via localhost in your machine. Once you have done these, take a look at the URL to write down the PORT number ( Number which appears after localhost name).
Step 2: Find your local IP address IPV4.
Open your terminal or command prompt and type ipconfig and just press enter key. You’ll see like these:
Just look at your IPv4 address and write it anywhere.
Step 3: View your application on other devices.
Once you have both your PORT number and IPv4 address, simply type in your mobile or device browsers like IPv4 address:PORT. For example, 522.214.171.1245:1234
The format is exactly the same. Once you run in the browser you’ll see your applications.