Skip to content
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

doesn't work with localhost, but ok with 127.0.0.1 (guessing related to IPv6) #194

Closed
halturin opened this issue Aug 16, 2023 · 2 comments
Closed

Comments

@halturin
Copy link

halturin commented Aug 16, 2023

I got a weird issue. Tried to connect using
websocat ws://localhost:9090/ws
and got this error:

websocat: WebSocketError: I/O failure
websocat: error running

if I change the hostname to the IP address it works well.

my /etc/hosts has localhost records

127.0.0.1 localhost
::1 localhost

telnet command works well with the localhost hostname

$ telnet localhost 9090
Trying ::1...
Connection failed: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

I guess it tried the IPv6 address, got connection refused, and exited.

@vi
Copy link
Owner

vi commented Aug 16, 2023

It is know "happy eyeballs" deficiency in Websocat 1.0: #23 (comment)

You can workaround with wc-c:tcp: if proper hostname handling is really needed (or just use specific IP address if it is just localhost).

@halturin
Copy link
Author

Thanks for clarifying. It would be great to be mentioned in the README file.

vi added a commit that referenced this issue Aug 16, 2023
vi added a commit that referenced this issue Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants