-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to server on Windows from WSL #11720
Comments
View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
Diagnostic information
|
Hi, @BlackStar7713 can you try following steps and check if its work: Step 1: Getting IP address of windows machine using following command. Step 2: Try curl with the IP address you got in step 1 and port with your given port. |
Hi @osamakhanedu |
Windows Version
Microsoft Windows [Version 10.0.22631.3737]
WSL Version
WSL version: 2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
Linux version 5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
nodejs v20.15.0
Repro Steps
I have an issue connecting to a server, and during debugging I created this minimal example:
Follow instructions in https://learn.microsoft.com/en-us/windows/wsl/networking under Accessing Windows networking apps from Linux (host IP).
I created a simple nodejs server like follows;
When using curl http://127.0.0.1:5000 I get the expected response, and output in the server console
On WSL i checked /etc/resolv.conf for the nameserver ip (10.255.255.254 in my case) and called curl http://10.255.255.254:5000
Expected Behavior
I expect the response Hello World and a http request to be received by the server
Actual Behavior
The command fails:
curl: (7) Failed to connect to 10.255.255.254 port 5000 after 0 ms: Connection refused
Diagnostic Logs
WslLogs-2024-06-21_00-16-49.zip
The text was updated successfully, but these errors were encountered: