Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

live server vscode on another computer

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?

like image 392
rony Avatar asked Dec 13 '25 18:12

rony


2 Answers

This is what worked for me in VS Code:

1.- Go to your extensions option:

enter image description here

2.- Make sure you have the "Use Local Ip" option checked: enter image description here

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:

enter image description here

like image 123
Valdemar Avatar answered Dec 16 '25 17:12

Valdemar


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.

like image 45
Aregawi Avatar answered Dec 16 '25 17:12

Aregawi