2

I'm using windows10 pro on PC and android on mobile. and i followed this process below.

Why can't I enter the url on my phone's browser to view my live site?

127.0.0.1 is a special-purpose IPv4 address reserved for loopback purposes. That is, this IP refers to >your computer itself.

By entering http://127.0.0.1:5500/index.html in your browser, you're requesting web page within your >computer.

In normal case, your computer will be in a NAT network (under same wi-fi AP for instance), and you'll be >assigned with a virtual IP. Normally it's 192.168.x.x.

You may enter the following command in your command prompt to see your IP address.

ipconfig

As a result, under your network interface card, you'll get your IP Address.

If the IP address belongs to virtual IP, then you may access it with your phone using

http://< Your IP Address >:5500/index.html

If it's not virtual IP, it is Public IP. Then, you'll have to configure appropriate Firewall settings >under this circumstance.

Hope this will help.

then i'm done this : Control Panel -> Windows Defender Firewall -> Allow an app or feature through Windows Defender Firewall -> Allowed "code.exe" app.

but on my mobile device, There is still ERR_ADDRESS_UNREACHABLE. and i also followed official instruction. still not work on my mobile device.. enter image description here

is there another method?

Lee TaeWon
  • 51
  • 1
  • 7
  • Are you able to open that same `ip_address:PORT` URL on the PC's browser? – Rohit Khandelwal Apr 26 '21 at 06:00
  • Address unreachable means your phone can't connect to the server at all, You need to make sure you are on the same IP subnet, you are not connected to data accidentally instead of WLAN and make sure you are typing in the correct IP of server. You can try your luck with `http://:` too. – Bijay Regmi Apr 26 '21 at 06:00
  • @RohitKhandelwal yes i can open ```192.168.xx.xxx:5500/test.html``` on my pc's browser. but i can't open ```192.168.xx.xxx:5500/test.html``` on my mobile device. – Lee TaeWon Apr 26 '21 at 06:04
  • @BijayRegmi i made sure that pc and mobile are on the same wifi. and i checked they are on same ip. by the way how can i know my computer name? – Lee TaeWon Apr 26 '21 at 06:10
  • @Lee TaeWon, type `hostname` in cmd. – TechySharnav Apr 26 '21 at 06:22
  • @TechySharnav Thanks~ but still not connect mobile to server... – Lee TaeWon Apr 26 '21 at 06:23
  • @Lee TaeWon, I tried it on my end, and its working fine. Get your `IPv4 Address` address from `ipconfig` and type it on browser, followed by `:` (which you can get by running live server.) – TechySharnav Apr 26 '21 at 06:31
  • @TechySharnav I just tried it using hotspot. and it works. but why doesn't it work on public wifi? – Lee TaeWon Apr 26 '21 at 06:46

2 Answers2

2

just connect your mobile with your laptop/PC hotpot and go to cmd and type config and take your IP ADDRESS and just put your server IP ADDRESS in browser it will run:)

  • thanks for your help. but is there other way not using hotspot? cause i'm in situation that can't use data – Lee TaeWon Apr 26 '21 at 06:36
  • i just tried it and it works. but i want to connect that on public wifi. is there a way? – Lee TaeWon Apr 26 '21 at 06:50
  • see it is a localhost means it only connect with hotstop and wifi without using data. so if you want to do public either you host or connect to your hotspot every one with it. – iamgauravsingh30 May 08 '21 at 12:45
0

oh i found it!!!! if there is anyone who use public wifi don't do that... it works on only private wifi.. Thank you everyone for helping me i love you guys!!!!

Lee TaeWon
  • 51
  • 1
  • 7
  • i think 'network profile' and 'security type' are important... you should change from public to private in network profile. or change from public to wpa2-personal in security type. – Lee TaeWon Apr 26 '21 at 10:56