Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ismarsantos/5c98d1100eb05987fa47943c81594507 to your computer and use it in GitHub Desktop.
Save ismarsantos/5c98d1100eb05987fa47943c81594507 to your computer and use it in GitHub Desktop.
Access WSL webserver in local network
See this video, it helped me:
https://www.youtube.com/watch?v=yCK3easuYm4
netsh interface portproxy add v4tov4 listenport=<port-to-listen> listenaddress=0.0.0.0 connectport=<port-to-forward> connectaddress=<forward-to-this-IP-address>
for example
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=127.0.0.1
Microsoft has published a little bit of information about this on their WSL1 to WSL2 comparison page
https://learn.microsoft.com/en-us/windows/wsl/compare-versions#accessing-a-wsl-2-distribution-from-your-local-area-network-lan
source https://stackoverflow.com/a/63781351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment