I am trying to develop a web app via remote tunnel on another computer.
Let's say we have two computers:
Computer A:
with the source code for the laravel app.
Computer B:
my device which I am traveling with.
Normally on computer A I can just run a dev command to be able to view the web app in the browser on a port on the localhost like http://localhost:3000
.
I am able to connect computer B to computer A to edit the source code for my web app, but how can I view the web app in the browser to test it?
I found the solution. The key is to open the remote computer (Computer A) which you have connected via the tunnel in VS Code and use the remote port forwarding (described at: https://code.visualstudio.com/docs/editor/port-forwarding) to forward the port on which your app is being served locally on Computer A.
This will give you a URL as a forwarded address, which you can use on Computer B or any other device to view the web app. Connecting to this forwarded address in your browser will require the same login as your tunnel thereby being a secure way of accessing it.