vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
7.14k stars 278 forks source link

Broken when running against solana-test-validator #175

Open esemeniuc opened 1 year ago

esemeniuc commented 1 year ago

Seems to fail when using localhost versus a direct ip

# localhost fails
➜  ~ websocat -v ws://localhost:8900/
[INFO  websocat::lints] Auto-inserting the line mode
[INFO  websocat::stdio_threaded_peer] get_stdio_peer (threaded)
[INFO  websocat::ws_client_peer] get_ws_client_peer
websocat: WebSocketError: I/O failure
websocat: error running

# ip works
➜  ~ websocat -v ws://127.0.0.1:8900/
[INFO  websocat::lints] Auto-inserting the line mode
[INFO  websocat::stdio_threaded_peer] get_stdio_peer (threaded)
[INFO  websocat::ws_client_peer] get_ws_client_peer
[INFO  websocat::ws_client_peer] Connected to ws

Platform

Arch linux
5.15.82-1-lts
websocat 1.11.0
solana-test-validator 1.14.10 (src:df128573; feat:3036606309)
vi commented 1 year ago

Probably IPv6 failure. Does ws://[::1]:8900/ work?

Unfortunately, Websocat v1 does not properly support Happy Eyeballs (unlike Websocat v3), so if hostname resovles to multiple IPs, it would work reliably if all of them work (e.g. if server listens for IPv6+IPv4 instead of just IPv4).

Duplicate of #23.

esemeniuc commented 1 year ago

Unfortunately the ipv6 endpoint doesn't work:

➜  ~ websocat -v "ws://[::1]:8900/"
[INFO  websocat::lints] Auto-inserting the line mode
[INFO  websocat::stdio_threaded_peer] get_stdio_peer (threaded)
[INFO  websocat::ws_client_peer] get_ws_client_peer
websocat: WebSocketError: I/O failure
websocat: error running
➜  ~

By default the service listens to ipv4 only:

➜  ~ sudo ss -tulpn | grep 8900
tcp   LISTEN 0      1024                                     0.0.0.0:8900       0.0.0.0:*    users:(("solana-test-val",pid=298084,fd=85))                                                                                                    
➜  ~