1# uwsc - Ulfius WebSocket Client
2
3Simple command-line application to connect to websocket services
4
5Copyright 2018-2020 Nicolas Mora <mail@babelouest.org>
6
7This program is free software; you can redistribute it and/or modify it under the terms of the GPL3 License.
8
9## Overview
10
11Can connect to websocket services, both ws:// (http) or wss:// (https). When the websocket is connected, messages from the server are displayed in the terminal and messages can be sent to the service via a prompt `> `.
12
13To quit uwsc during connection, enter the message `!q`.
14
15## Options
16
17Options available:
18
19```shell
20-o --output-log-file=PATH
21	Print yder log messages in a file
22-x --add-header=HEADER
23	Add the specified header of the form 'key:value'
24-b --send-binary-file=PATH
25	Sends the content of a file at the beginning of the connection in a binary frame
26-t --send-text-file=PATH
27	Sends the content of a file at the beginning of the connection in a text frame
28-i --non-interactive-send
29	Do not prompt for message sending
30-l --non-listening
31	Do not listen for incoming messages
32-f --fragmentation=
33	Specify the max length of a frame and fragment the message to send if required, 0 means no fragmentation, default 0
34-p --protocol=PROTOCOL
35	Specify the Websocket Protocol values, default none
36-e --extensions=EXTENSION
37	Specify the Websocket extensions values, default none
38-s --non-secure
39	Do not check server certificate
40-s --non-secure
41	Do not check server certificate
42-q --quiet
43	Quiet mode, show only websocket messages
44-v --version
45	Print Glewlwyd's current version
46
47-h --help
48	Print this message
49```
50
51## Examples
52
53Here are some examples on how to use uwsc options
54
55```shell
56$ # run uwsc to a websocket service
57$ uwsc http://localhost:9275/websocket
58$ # run uwsc to a secured websocket service
59$ uwsc https://localhost:9275/websocket
60$ # run uwsc with a specified protocol and extension list
61$ uwsc --protocol=myProtocol --extensions=ext1;ext2
62$ # run uwsc to a websocket service with additional header values
63$ uwsc --add-header="Authorization: Bearer abcd.efgh.xyz" --add-header="pragma: no-cache" http://localhost:9275/websocket
64$ # run uwsc to send a text file content to the service as first message, then the prompt will be available
65$ uwsc --send-text-file=/path/to/file http://localhost:9275/websocket
66$ # run uwsc without prompt
67$ uwsc -i http://localhost:9275/websocket
68$ # all messages will be fragmented with the maximum payload size specified
69$ uwsc --fragmentation=42 http://localhost:9275/websocket
70```
71