vi / websocat

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

Prevent shutdown / exit on empty line? #67

Open clarkewd opened 4 years ago

clarkewd commented 4 years ago

I'm running the websocat client and noticed that if the server sends a blank line (an empty message) then the client seems to shutdown and further communication with the server isn't possible:

[DEBUG websocat::ws_peer] incoming text
[DEBUG websocat::my_copy] zero len
[DEBUG websocat::my_copy] read_done
[DEBUG websocat::my_copy] done
[INFO  websocat::sessionserve] Reverse finished
[INFO  websocat::sessionserve] Reverse shutdown finished

Looking at the code, I think the setting I need to change is the bool stop_on_reader_zero_read which is set to true

I've looked over the long version of the help but I don't see a way to change this to be false - is it possible?

vi commented 4 years ago

Implemented relevant options and published a (not even a pre-release) build: https://github.com/vi/websocat/releases/tag/v2.0.0-alpha0

Please test.

clarkewd commented 4 years ago

Tested and working - thank you!

One note: I think there may be a typo no-exist-on-zeromsg instead of no-exit-on-zeromsg

Also, your release has 25 binaries. Wow! How do you build this for so many platforms? Hopefully not each one manually??

vi commented 4 years ago

One note: I think there may be a typo no-exist-on-zeromsg instead of no-exit-on-zeromsg

Yes, it's a typo. Will retag and re-upload release assets soon.

vi commented 4 years ago

Also, your release has 25 binaries. Wow! How do you build this for so many platforms? Hopefully not each one manually??

This hack. Rust is typically good at cross-compilation if you don't use too much C libraries and help it with linking. Everything is built on Linux (most things outside Docker).

Serious projects should however use CI setup (e.g. using Travis) and upload executables from there instead of replying on builds from dev environments.

P.S. just added a MIPS version.