How to access and test localhost from your devices over your wi-fi network
I have been thinking about how to access to my localhost in windows from Android/Apple devices. Every now and then, web developers bump into the problem of accessing localhost sites/apps from their mobile devices.
As a general practice, all files of a website are uploaded to remote server (generally under a subdomain named "demo") and tested using various devices and browsers. Whenever any file goes under any change, it is again uploaded to remote server for testing. This is certainly time consuming and tiresome task.
I develop my all sites, static or dynamic, on my personal computer, with the help of XAMPP 5.6.3 (32-bit).
Recently, I have learned about accessing localhost over Wi-fi from a tutorial.Through this process, now I can access my localhost from mobile devices, test my sites locally to meet cleint's demands with ease!!! This new method has made my development process faster and easier.
My Networking Setup
Fig. 1 and Fig. 2 shows a general picture of my networking setup. My PC is connected to my Wi-fi router using RJ-45 cable and my mobile phone and Samsung tab also connect to the Internet through Wi-fi. First thing is to get the IP address of my localhost. Open command-line box using "cmd" command from Windows Run and type "ipconfig". ipconfig gives me IP address of localhost (PC) which is "10.0.0.101".
Figure 1: Network diagram
Figure 2: Finding IP address of PC
This is it. This is minimum setup for you to access your websites which resides in your “localhost”.
Now to test the setup. Take up your Android device or iOS device and fire up your browser. Type in the address of your localhost in the address bar, http://10.0.0.101 and tap on the “Go” button. You should see the content of the localhost, like the following:
I have been using this setup now and quite happy that it’s working for me well. I hope that this model will come handy in your case too.
Well, how do you test your web projects from your devices for responsiveness? Please express your thoughts in the comment section and share the information with us. Thank you for reading!
- Category: Webmaster
Do you want to be an SEO expert?
SEO 10-07-2017 Hits: 208
How to Increase the Views of YouTube Videos in Organic Ways
Social Media 04-06-2017 Hits: 467
Facebook Ad Retargeting: How Does Facebook Get The Whereabouts of Our Visited Websites?
Social Media 21-05-2017 Hits: 530
Increase Twitter Engagement: 11 Easy How-Tos
Social Media 11-05-2017 Hits: 553
How to Use WordPress Custom Logo API: With Code Example
WordPress 07-05-2017 Hits: 893
10 Important WordPress Plugins and Tools for SEO to Rank Your WordPress Website Even Better
WordPress 20-04-2017 Hits: 1041
Move WordPress Site from Localhost to Live Server: Step-by-step Tutorial with Screenshots
WordPress 17-04-2017 Hits: 1025
Most Read Tutorials
How to combine all .vcf files to single .vcf file manually to merge into Gmail Contacts
Webmaster 23-05-2015 Hits: 65283
Get component, module and plugin parameters in Joomla 3
Joomla 3.0 24-07-2014 Hits: 32313
How do you detect a website visitor's country?
Webmaster 30-05-2013 Hits: 18217
Troubleshooting Joomla 3.0 Database Connection Errors
Joomla 3.0 17-03-2013 Hits: 18215
How to setup SMTP in Joomla 2.5 to send emails
Joomla 2.5 23-07-2012 Hits: 16379
Fixing JFolder::create: Path not in open_basedir paths
Joomla 3.0 22-02-2014 Hits: 16230
Open a Port in Firewall in Windows 7 OS
Windows 18-07-2012 Hits: 14994
How to fix 'Creating default object from empty value' PHP warning in Joomla
Joomla 3.0 23-10-2013 Hits: 14581
How to add Google Analytics code in Joomla! 2.5 template
Joomla 2.5 14-07-2012 Hits: 14427
Using Popover on Hover with Twitter Bootstrap in Joomla 3
Joomla 3.0 06-07-2013 Hits: 14416
Store user state variables in Joomla 2.5/3.0
Joomla 3.0 24-03-2013 Hits: 13913
NetBeans auto completion does not show class methods when using Singleton design pattern
Joomla 3.0 24-02-2014 Hits: 9062