Send Commands
Is there a way to send commands and pipe output (using -x for example flag in this case)?
wscat -c ws://localhost9222 -x "{"id": 1, "method": "Network.enable"}"
wscat -c ws://localhost9222 -x "{"id": 1, "method": "Page.navigate", "params" : {"url" : "http://www.github.com"}}" > out.log
Ideally, pass a command and somehow pipe output? Does this functionality already exist or is there an easy way to accomplish this?
I needed to do something VERY similar and since this issue is open since such a long time, I figured I give it a go myself. It's in the branch: addexecute of my fork.
Usage is pretty much as you wanted:
wscat -c ws://localhost9222 -x '{"id": 1, "method": "Network.enable"}'
or
wscat -c ws://localhost9222 -x '{"id": 1, "method": "Network.enable"}' > out.log
I added one more parameter do deal with slow requests.
-w or --wait <seconds> will make it wait for a set amount of seconds before quitting (default is 2 seconds)
Done with #58