-
Notifications
You must be signed in to change notification settings - Fork 844
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
Can't connect to WSL2 application via Websockets when using Postman like application #9549
Comments
I'm seeing this same issue. My guess is that they automatically try connecting to 127.0.0.1 which WSL doesn't like. |
I have same issue. I'm unable to connect to either Postman or any other application. |
@filipe-costa My issue was server was started on ipv6 which was unable to listen. You can use BUT, you might get a new error socket hang up. Now, this will be because you are using socket.io library and going through the documentation, it seems like it expects socket.io-client, its own library for proper handshake to establish a connection. So, we might not be able to do it from postman at all. What you can try is using the base ws library which is barebone of websockets (upon which socket.io runs). I was able to establish a connection through it. But being barebone, you will have to do everything yourself if you go down this road. |
Also, just going through postman in detail, it does have a separate request type for socket.io and it works. |
@filipe-costa To make a postman call, you must specify the wsl ip address, not localhost. You can find it using the command However, this does not work for socket.io And I haven't figured out why yet. |
Version
Microsoft Windows [Version 10.0.22621.1105]
WSL Version
Kernel Version
5.15.79.1
Distro Version
Ubuntu 22.04
Other Software
Postman for Windows, version 10.8.7
Insomnia for Windows, version 2022.7.5
Repro Steps
Demo application - https://github.com/filipe-costa/repro-demo-wsl2-websockets
npm install
node index.js
ws://localhost:3000/
Expected Behavior
I expected to be able to connect to the WSL2 application that has a WebSocket endpoint without any issues. On the other hand, it is possible to connect to it via a Web Browser.
Actual Behavior
Similar issues:
#7849
#4204
Diagnostic Logs
WslLogs-2023-01-27_18-46-42.zip
The text was updated successfully, but these errors were encountered: