grandalph
grandalph

Reputation: 85

'localhost' on VS Code SSH Remote is Accessible on Local Machine

I am develping using VS code SSH remote and I have an app runing on my remote machine on localhost.

When I try to access the app from my local machine, I cannot reach it from the IP address of the remote machine. Instead, I can access it on localhost on my LOCAL machine.

This doesn't quite make sense to me.

Any idea why this is the case? Is VS Code doing some magic here? If so, how to disable this?

Upvotes: 4

Views: 4911

Answers (2)

Jenish Jerome
Jenish Jerome

Reputation: 352

Thats because Visual Studio Code Remote - SSH extension does port forwarding behind the scene.

enter image description here

Upvotes: 0

Moaz Ashraf
Moaz Ashraf

Reputation: 230

If you are using the Visual Studio Code Remote - SSH extension, then yes. That "magic" is called port forwarding/SSH tunnelling. You can check currently forwarded ports in the Ports view. More info here: Forwarding a port / creating SSH tunnel.

Upvotes: 3

Related Questions