WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Unreal behavior of WSL/Ubuntu and reaching Localhost:3000: localhost didn’t send any data

Open vlajov opened this issue 2 years ago • 7 comments

Windows Version

Microsoft Windows [Version 10.0.19045.3930]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.133.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

After binding the express app to 0.0.0.0

image

the app is not loading on localhost:3000 but it does on WSLIP:3000

image

Once I remove the binding, app loads in both cases (IP:3000 and localhost:3000).

Expected Behavior

These steps are from tutorial, which I also did like 2 months ago: https://www.linkedin.com/learning/learning-windows-subsystem-for-linux-16134127/accessing-a-wsl-network-service

and everything worked as expected and shown by the instructor.

Now as I repeat the same thing, it's getting worse and worse.

Actual Behavior

Two days ago I had issue with the express app on WSL unreachable from LAN devices. Today after reinstalling WSL and Ubuntu, and starting anew, I got this new issue for which I cannot imagine what can be the reason.

Diagnostic Logs

No response

### Tasks
- [ ] https://github.com/microsoft/WSL/issues/4619
- [ ] https://github.com/microsoft/WSL/issues/8509

vlajov avatar Jan 15 '24 02:01 vlajov

So, today after not changing anything, just started the express app and voila loads both on WSLIP:3000 and localhost:3000

image

It's mystery to me what was causing the issue.

vlajov avatar Jan 15 '24 17:01 vlajov

Can you post your .wslconfig?

ghost avatar Jan 16 '24 19:01 ghost

Can you post your .wslconfig?

It doesn't exit. Which is a default https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig

vlajov avatar Jan 16 '24 20:01 vlajov

This is happening again, same problem with docker container... any news?

michele6000 avatar Jan 22 '24 18:01 michele6000

This is happening again, same problem with docker container... any news?

All good for me now

vlajov avatar Jan 22 '24 21:01 vlajov

I find out the problem. Is about docker integration with WSL when enabled it take port 3000 only on localhost.

Workaround: disable it.

Maybe is a problem of docker desktop, I'll open a issue suggesting to change port

michele6000 avatar Jan 22 '24 21:01 michele6000

Closing since the original issue is resolved

OneBlue avatar May 09 '24 18:05 OneBlue