Created
June 7, 2023 15:30
-
-
Save ismarsantos/5c98d1100eb05987fa47943c81594507 to your computer and use it in GitHub Desktop.
Access WSL webserver in local network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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