| 1 |
# General |
| 2 |
|
| 3 |
ws is a command line tool that should exercise most of the IXWebSocket code, and provide example code. |
| 4 |
|
| 5 |
``` |
| 6 |
$ ws --help |
| 7 |
ws is a websocket tool |
| 8 |
Usage: ws [OPTIONS] SUBCOMMAND |
| 9 |
|
| 10 |
Options: |
| 11 |
-h,--help Print this help message and exit |
| 12 |
|
| 13 |
Subcommands: |
| 14 |
send Send a file |
| 15 |
receive Receive a file |
| 16 |
transfer Broadcasting server |
| 17 |
connect Connect to a remote server |
| 18 |
chat Group chat |
| 19 |
echo_server Echo server |
| 20 |
broadcast_server Broadcasting server |
| 21 |
ping Ping pong |
| 22 |
curl HTTP Client |
| 23 |
redis_publish Redis publisher |
| 24 |
redis_subscribe Redis subscriber |
| 25 |
``` |
| 26 |
|
| 27 |
## file transfer |
| 28 |
|
| 29 |
``` |
| 30 |
# Start transfer server, which is just a broadcast server at this point |
| 31 |
ws transfer # running on port 8080. |
| 32 |
|
| 33 |
# Start receiver first |
| 34 |
ws receive ws://localhost:8080 |
| 35 |
|
| 36 |
# Then send a file. File will be received and written to disk by the receiver process |
| 37 |
ws send ws://localhost:8080 /file/to/path |
| 38 |
``` |
| 39 |
|
| 40 |
## curl |
| 41 |
|
| 42 |
``` |
| 43 |
$ ws curl --help |
| 44 |
HTTP Client |
| 45 |
Usage: ws curl [OPTIONS] url |
| 46 |
|
| 47 |
Positionals: |
| 48 |
url TEXT REQUIRED Connection url |
| 49 |
|
| 50 |
Options: |
| 51 |
-h,--help Print this help message and exit |
| 52 |
-d TEXT Form data |
| 53 |
-F TEXT Form data |
| 54 |
-H TEXT Header |
| 55 |
--output TEXT Output file |
| 56 |
-I Send a HEAD request |
| 57 |
-L Follow redirects |
| 58 |
--max-redirects INT Max Redirects |
| 59 |
-v Verbose |
| 60 |
-O Save output to disk |
| 61 |
--compress Enable gzip compression |
| 62 |
--connect-timeout INT Connection timeout |
| 63 |
--transfer-timeout INT Transfer timeout |
| 64 |
``` |