Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Where I work we stream loads of market data, and the client is the boss of what it would like to stream. It can decide to stream the Oslo stock exchange in real time, for example. This we do via a
subscribe
string.When working with services that use websockets, we usually don't get it right the first time. This means that we have to work on our servlet, then use
wscat
to check the data is correct, make changes and restart. It would be great to be able to just use arrow up to do the same subscribe, and not have to have the subscribe string in notepad on the side, using copy and paste to get the data out from the server.It is also useful to be able to send a single wscat command to another developer, and not two commands they have to do in sequence. Minor, but a quality of life bump that is much appreciated.
This change would also make scripting easier, as you could simply pipe the command into
grep
,awk
, etc, without having to do clever bash workarounds to send that inital message.What
This PR adds a new argument,
-m, --message
. This tells wscat to send the provided message to the server as soon as it is ready.Result