maybe add discussions? maybe stats like curl?
I am quite new to websockets. I was wondering if (or how) I could use websocat to test a file transfers over ws?
The other thing is I did not see anything in ./websocat --help=long about reporting stats, maybe that could be interesting? Curl has this:
-w '%{http_code},%{time_connect},%{time_total},%{speed_upload},%{size_upload}'
about reporting stats, maybe that could be interesting?
There is Prometheus mode (mostly untested and not activated by default) that has some stats.
Easier counter/stats overlay can be added (probably to Websocat4) sometime.
http_code
This is currently available only in -v -v logs, as far as I remember.
-w
Maybe such option will eventually appear in Websocat in a form that resembles Curl.
maybe add discussions?
Do you mean Github discussions? What advantages do they have compared to issues (that are typically used for support and feature proposals in my projects).
What about how to test file transfers?
websocat -v 'ws://localhost:9000'
[INFO websocat::net_peer] Connected to TCP 127.0.0.1:9000 websocat: WebSocketError: WebSocket HTTP error: Invalid HTTP version specified websocat: error running
I don't want to use the handshake, just plain ws. I assumed giving the ws is forcing this, so why do I see http? How can I only test ws?
I don't want to use the handshake, just plain ws.
Use ws-lowlevel-client: overlay instead of ws:// URL. This would just get WebSocket framing without WebSocket handshake.
websocat -t - ws-lowlevel-client:tcp:127.0.0.1:9000
What about how to test file transfers?
websocat -ub readfile:myfile.txt ws://...
websocat -ub ws://... writefile:downloaded.dat
websocat -ub --async-stdio ws://... > output_file
websocat -Ub --async-stdio ws://... < input_file
and so on