How to run HTML locally as a participant on VS Code Live Share?

648 Views Asked by At

My friend and I are coding a website using vs code live share. My friend is hosting the live share from his device and all the code is saved on his laptop. He is able to preview the website by running locally on his laptop, however I cannot run locally from my end of the live share. we are not sure what the issue might be. If you have any ideas/solutions please reply

1

There are 1 best solutions below

0
starball On

If you want guests/participants to be able to locally run the frontend accessing a backend server running on the Live Share session host's machine, then the host can use the "Share Server" feature. Basically, they click the "Share Server" button, then specify the port number that the server is running on. The Live Server client each guest is running will "tunnel" that same port on their localhost address through the Live Server connection to the server running on that port on the host's machine.

If the guest/participant wants to run the server themselves from their own machine, then you might want to take a look at In the Live Share extension of VS Code, can users that joined a session run shared code in their own terminal?.