Server not accessible from Windows, after starting it from WSL

From alzaar on Discord:

Hi guys! I am trying to set up a local dev environment for the app. The client is up and running, however the backend server is unresponsive. I am getting no response on my browser if I open https://localhost:8080/. I am using WSL and everything is set up. The last line on the terminal states that a connection is opened to mongo on localhost:$port. Am I missing something ? How long does it take to get the server up. I followed the instructions on this page
appsmith/ServerSetup.md at master · appsmithorg/appsmith · GitHub

The server was run using the start-dev-server.sh script from inside WSL.

Logs from server:

  • Mongock is trying to release the lock.
  • Mongock released the lock
  • Mongock has finished his job.
  • Triggering registration of this instance…
  • Opened connection [connectionId{localValue:4, serverValue:20}] to localhost:27018

Also from alzaar:

Thanks for the help :slight_smile: I ran this command netstat -ano | findstr :8080 to see if the server is even running and it turns out it is not. When I run the same command on WSL I get an output that it is listening. This made me think that WSL maps ports differently to and from windows. Turns out I need to configure localhost forwarding to windows from WSL. Seems more complicated than I initially thought it to be. Will look into this further during the week. Thanks again!

1 Like

Hey! Anyone who also ran into this issue. It is not completely functional yet however a quick update:
I found how to forward requests on local ports, in this case localhost based on this info from Microsoft.

With this, we are forwarding all requests from a windows machine to WSL. I ran a test with local react server and ran it in WSL with port mapping enabled with this command.

netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=127.0.0.1

This works perfectly fine. But when I did the same for port 8080 as such:

netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=127.0.0.1

It didn’t work. It seems something else is going on. This will require further investigation.