I have 2 computers. when I open the project with live server on the first one it gives me this url 127.0.0.1:5500/index.html I want to put that url on the other computer's browser but it doesn't work. is there any solution to this?
-
2try to use the IP of the computer that has the liver server running instead of `127.0.0.1` line `192.168.0.50:5500/index.html` or use the name of that computer as known in the hosts table on the computer with the browser – rioV8 Sep 19 '20 at 10:48
-
[This question has the answer. I had the same problem. It's working now. I write my HTML on my desktop. And watch the magic on my laptop.](https://stackoverflow.com/questions/52943330/vs-live-share-and-live-server) – Hugo Leonardo Dec 11 '20 at 19:49
-
I had the same question. But I've checked the link below. And this guy has the answer to solve your problem. I had the same doubt. But it's working fine right now. [vs-live-share-and-live-server](https://stackoverflow.com/questions/52943330/vs-live-share-and-live-server) – Hugo Leonardo Dec 11 '20 at 19:55
6 Answers
This is what worked for me in VS Code:
1.- Go to your extensions option:
2.- Make sure you have the "Use Local Ip" option checked:
3.- Check on your terminal for your local Ip address (ipconfig
on windows for example) and substitute the ip address from your live server url with you local ip:

- 221
- 2
- 4
You can try port forwarding using powershell on the hosting computer. I use wsl2 and when I want a preview on another computer I port forward using powershell
netsh interface portproxy add v4tov4 listenport=xxxx listenaddress=(host pc ip address) connectport=yyyy connectaddress=(wsl2 ip address)
In your case try making the listenaddress and connectaddress the same (which is your main pc) and the listen and connect ports 5500 using the above script.
After that the last step you should perform is add Inbound Rules inside your firewall.

- 41
- 3
you can go to settings live server and check the use local ip option, then you stop live server and start over again. Now live server use an direction with local ip and you can open your file in other pc. enter image description here

- 11
- 1
It doesn't work because you are using loopback address (127.0.0.1), in order to access your live server on entire LAN you need to change this address in vscode/liveserver settings to your private address, it will be something like (192.168.100.XXX)

- 11
- 2
put port 5500 in firewall to access from other pc
connect pc via lan and set static ip
then call it like xxx.xxx.xxx.xxx:5500/

- 1,711
- 1
- 13
- 16
You need nothing extra. Just type your local IPv4 Address which you can find in Command Prompt by typing " ipconfig ", then on another computer in browser type this IPv4:5500 and it's done. (You must have Live Server On)
Example: 192.168.1.5:5500

- 153
- 10