eliihen / wsta

A CLI development tool for WebSocket APIs
GNU General Public License v3.0
631 stars 19 forks source link

Write everything that is not websocket frames to stderr #4

Closed eliihen closed 8 years ago

eliihen commented 8 years ago

For a user, this is confusing:

$ wsta -I ws://example.com | jq .
parse error: Invalid numeric literal at line 1, column 13
Connected to ws://example.com/
thread '<unnamed>' panicked at 'failed printing to stdout: Broken pipe (os error 32)', ../src/libstd/io/stdio.rs:617
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This happens because -I prints headers, which jq cannot parse. jq then exits, breaking the pipe.

The problem is twofold, both of which should be adressed: