| 1 |
.\" This manual page was written for the Debian project, based on the usage |
| 2 |
.\" message and option help strings in src/websockets/cli.py and on the |
| 3 |
.\" upstream documentation at https://websockets.readthedocs.io/ |
| 4 |
.TH WEBSOCKETS 1 "2026-09-13" "websockets" "User Commands" |
| 5 |
.SH NAME |
| 6 |
websockets \- interactive WebSocket client |
| 7 |
.SH SYNOPSIS |
| 8 |
.B websockets |
| 9 |
.RB [ \-\-help ] |
| 10 |
.RB [ \-\-insecure ] |
| 11 |
.RB [ \-\-version ] |
| 12 |
.RI [ uri ] |
| 13 |
.SH DESCRIPTION |
| 14 |
.B websockets |
| 15 |
is an interactive WebSocket client. It connects to the WebSocket server at |
| 16 |
.IR uri , |
| 17 |
then sends every line typed on standard input as a text message and prints |
| 18 |
every message received from the server. Type Ctrl\-D to close the connection, |
| 19 |
or Ctrl\-C to interrupt it. |
| 20 |
.PP |
| 21 |
It is intended for testing and debugging WebSocket servers from a terminal, |
| 22 |
and is part of the |
| 23 |
.B websockets |
| 24 |
Python library. |
| 25 |
.PP |
| 26 |
.I uri |
| 27 |
is a WebSocket URI, that is a URI with the |
| 28 |
.B ws:// |
| 29 |
or |
| 30 |
.B wss:// |
| 31 |
scheme, for example |
| 32 |
.BR ws://localhost:8765/ . |
| 33 |
.SH OPTIONS |
| 34 |
.TP |
| 35 |
.B \-\-help |
| 36 |
Show usage and exit. |
| 37 |
.TP |
| 38 |
.B \-\-insecure |
| 39 |
Disable TLS certificate verification. Only useful for |
| 40 |
.B wss:// |
| 41 |
connections, typically against a server using a self\-signed certificate. |
| 42 |
.TP |
| 43 |
.B \-\-version |
| 44 |
Show version and exit. |
| 45 |
.SH ENVIRONMENT |
| 46 |
Proxies are picked up from the operating system configuration and from the |
| 47 |
environment. If the server is in the proxy bypass list of the operating |
| 48 |
system or in |
| 49 |
.BR no_proxy , |
| 50 |
.B websockets |
| 51 |
connects directly. Otherwise it looks for a proxy in |
| 52 |
.BR wss_proxy " or " ws_proxy |
| 53 |
(for |
| 54 |
.BR wss:// " and " ws:// |
| 55 |
connections respectively), then for a SOCKS proxy configured in the operating |
| 56 |
system, then in |
| 57 |
.BR https_proxy , |
| 58 |
then \(em for |
| 59 |
.B ws:// |
| 60 |
connections only \(em in |
| 61 |
.BR http_proxy . |
| 62 |
Connecting through a SOCKS proxy requires the |
| 63 |
.B python3\-python\-socks |
| 64 |
package. |
| 65 |
.PP |
| 66 |
The following variables change the behaviour of the underlying library. |
| 67 |
.TP |
| 68 |
.B WEBSOCKETS_MAX_LOG_SIZE |
| 69 |
How much of each frame to show in debug logs. Default: |
| 70 |
.BR 75 . |
| 71 |
.TP |
| 72 |
.B WEBSOCKETS_USER_AGENT |
| 73 |
User\-Agent header sent by websockets. The default value uses the format |
| 74 |
.RB \(dq Python/x.y.z\ websockets/X.Y \(dq. |
| 75 |
.TP |
| 76 |
.B WEBSOCKETS_MAX_LINE_LENGTH |
| 77 |
Maximum length of the request or status line in the opening handshake. |
| 78 |
Default: |
| 79 |
.B 8192 |
| 80 |
bytes. |
| 81 |
.TP |
| 82 |
.B WEBSOCKETS_MAX_NUM_HEADERS |
| 83 |
Maximum number of HTTP headers in the opening handshake. Default: |
| 84 |
.BR 128 . |
| 85 |
.TP |
| 86 |
.B WEBSOCKETS_MAX_BODY_SIZE |
| 87 |
Maximum size of the body of an HTTP response in the opening handshake. |
| 88 |
Default: |
| 89 |
.B 1048576 |
| 90 |
bytes (1 MiB). |
| 91 |
.TP |
| 92 |
.B WEBSOCKETS_MAX_REDIRECTS |
| 93 |
Maximum number of redirects that the client follows. Default: |
| 94 |
.BR 10 . |
| 95 |
.SH EXAMPLES |
| 96 |
Connect to a server running on the local machine: |
| 97 |
.PP |
| 98 |
.RS |
| 99 |
.nf |
| 100 |
$ websockets ws://localhost:8765/ |
| 101 |
.fi |
| 102 |
.RE |
| 103 |
.SH SEE ALSO |
| 104 |
The full documentation for |
| 105 |
.B websockets |
| 106 |
is available at |
| 107 |
.BR https://websockets.readthedocs.io/ . |