Please correct the category of this post if it’s incorrect.
This is not a question, it’s a tip (learned it moments ago and would like to share it).
Hello all, I just learned a very cool trick and quite useful for my website responsive development. Probably some of you know it but it won’t hurt to share it with the community.
Sometimes when I do responsive design, I prefer to view the site on a real mobile instead of a virtual one. Since I have a mobile and a tablet let’s make them useful.
when you want to access your localhost/website from your mobile it gives an error, but let’s change
STEP 1: Find your computer’s IP address.
Windows:
open cmd
type this command: ipconfig
find this number:
MAC:
open Terminal
type this command: ifconfig | grep "inet " | grep -v 127.0.0.1
find this number:
STEP 2: Type that ip on your mobile.
But wait, you have to type the port after that ip address though. my localhost port is 8888
so in my mobile browser I’ll type this: 192.169.8.40:8888
Now you’ll see the “Index of /” page where you see your websites projects.
I did not navigate to system32 but ran the command from C
I have Windows version 10 not version 6
I did not enter a port number
Other than ipv6 numbers, I saw three IP numbers.
Two led to SERPs indicating they had something to do with Comcast Constant Guard. The other with Windows Internet Connection Sharing (my VMware adapter)
There may be a way to access my always running localhost server from my tablet over wifi, but I have a feeling your success may be due to luck and it isn’t always as easy as knowing an IP:port number. Maybe an alternative would be to have intranet cable connections?
To add onto what @rpkamp said, it’s because all devices that are connected to the same network can actually be accessed in this way. If you aren’t on the same network, you’ll be seeing something different. You pretty much have to know the local IP addresses to be able to view what those devices may have. You also aren’t required to supply the port number. You can just do something like 192.168.25 and it’ll show up. The only thing I would advise is that if those devices don’t have a localhost server set up, you won’t be seeing anything. I believe you’ll get your default browser error saying it can’t connect to that address.