Plug and play automation for wurl
wurl was always designed to be composable. This means other applications
can send messages by piping into it with a unix pipe (|
). A common use for
this is to implement a ping feature, where a ping message is periodically
sent to the server as a keepalive implementation. wurl-tools
makes this work
out of the box by passing an option:
wurl-tools -p "every 15s"
All data that wurl-tools
recieves on stdin
is forwarded to stdout
to make
further pipelining possible. This means that any data piped through wurl-tools
is forwarded to wurl, which will send the data to the server.
wurl-auth
USAGE:
wurl-tools --close <INSTRUCTION>... --message <INSTRUCTION>... --ping <INSTRUCTION>... --pong <INSTRUCTION>...
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --close <INSTRUCTION>... Send a close control frame
-m, --message <INSTRUCTION>... Send a WebSocket frame
-p, --ping <INSTRUCTION>... Send a ping control frame
--pong <INSTRUCTION>... Send a pong control frame
INSTRUCTION:
An instruction is a command that defines when and what to send. For
example, in order to send a custom ping every two seconds, the
following instruction may be used:
send {"type": "PING"} every 2s
To close a connection after a set time, you can use this instruction
with a close frame:
send 1000 Goodbye! after 15s
ms
- Millisecondss
,sec
- Secondsm
,min
- Minutesh
- Hoursd
,day
,days
- Days
wurl-tools -p 'every 15s' | wurl wss://websocket.example.com
NOT YET PUBLISHED
$ cargo install wurl-tools
If you are a rust programmer, it is easy to install wurl using the cargo CLI.
To update to a newer version, simply overwrite the old executable when installing.
$ cargo install --force wurl-tools
All tagged releases on GitHub have compiled binaries attached to them.
$ docker run -it --rm esphen/wurl-tools
If you do not have the rust toolchain installed and there is no package for your OS, you may use the docker image, which will run on all platforms that docker supports.
If you use docker, it may be an idea to add an alias to make running it through docker easy. For example:
$ alias wurl="docker run -it --rm esphen/wurl-tools"