Question about the FAQ: expose a port from WSL2
Closed this issue · 1 comments
I read this FAQ "What if I'm trying to expose a port from WSL2?" the answer state "Unforunately, this solution will not allow you to expose a port when on or off of VPN" but it is not clear if the limitation believes to:
- Connection from Windows host -> to WSL2
- Connection from a different physical machine -> to a port exposed from wsl2 inside windows host
If the answer is (1) this pone a serious limit because no service running in WSL could be reached from windows.
There are some workaround available?
I think when I wrote that line, local host did not work. But I was quickly reminded in sakai135/wsl-vpnkit#30 that localhost was supposed to work, and it appears that localhost still works. I should probably update the line in the readme.
Simple command: python3 -m http.server
Using Windows Defender Firewall and Sonicwall VPN. Results may vary
Testing on the windows host, both on and off VPN:
- ✔- http://localhost:8000
- ❌- http://VPN.IP:8000 (only exists when on VPN)
- ❌- http://main.ip:8000
- ❌- http://172.wsl.gateway.ip.1:8000
- ❌- http://172.wsl.ip.39:8000
- ❌- http://192.168.67.3:8000
- ❌- http://192.168.67.1:8000
Looks like localhost was the only thing to work out of the many IPs I tried.