Onevinn blog

Local Port Forwarding using Visual Studio Code (no ngrok needed)

Written by Tom Aafloen | 12 Dec 2023

Local port forwarding means that you expose an internal port on your local computer to the internet. Many people use a service called ngrok for this, but did you know that similar feature is built right into VS Code?

No firewall opening is needed for this to work, as VS Code only makes outbound connection to a service in Azure.


To secure the exposed port you need to authenticate with the same GitHub or Microsoft account both in VS Code and when accessing the port. While you CAN open a Public port, which means anyone on the internet can access that port on your local computer, that of course needs careful security consideration. As do using a port that requires authentication, check with your security team if this is allowed from your company computer. You can consider using a VM for this.

The domain name will start with global.rel.tunnels.api.visualstudio.com.

This is great for testing things. but of course not for production scenarios.

Read more about it here:
https://code.visualstudio.com/docs/editor/port-forwarding