.\" This manual page was written for the Debian project, based on the usage .\" message and option help strings in src/websockets/cli.py and on the .\" upstream documentation at https://websockets.readthedocs.io/ .TH WEBSOCKETS 1 "2026-09-13" "websockets" "User Commands" .SH NAME websockets \- interactive WebSocket client .SH SYNOPSIS .B websockets .RB [ \-\-help ] .RB [ \-\-insecure ] .RB [ \-\-version ] .RI [ uri ] .SH DESCRIPTION .B websockets is an interactive WebSocket client. It connects to the WebSocket server at .IR uri , then sends every line typed on standard input as a text message and prints every message received from the server. Type Ctrl\-D to close the connection, or Ctrl\-C to interrupt it. .PP It is intended for testing and debugging WebSocket servers from a terminal, and is part of the .B websockets Python library. .PP .I uri is a WebSocket URI, that is a URI with the .B ws:// or .B wss:// scheme, for example .BR ws://localhost:8765/ . .SH OPTIONS .TP .B \-\-help Show usage and exit. .TP .B \-\-insecure Disable TLS certificate verification. Only useful for .B wss:// connections, typically against a server using a self\-signed certificate. .TP .B \-\-version Show version and exit. .SH ENVIRONMENT Proxies are picked up from the operating system configuration and from the environment. If the server is in the proxy bypass list of the operating system or in .BR no_proxy , .B websockets connects directly. Otherwise it looks for a proxy in .BR wss_proxy " or " ws_proxy (for .BR wss:// " and " ws:// connections respectively), then for a SOCKS proxy configured in the operating system, then in .BR https_proxy , then \(em for .B ws:// connections only \(em in .BR http_proxy . Connecting through a SOCKS proxy requires the .B python3\-python\-socks package. .PP The following variables change the behaviour of the underlying library. .TP .B WEBSOCKETS_MAX_LOG_SIZE How much of each frame to show in debug logs. Default: .BR 75 . .TP .B WEBSOCKETS_USER_AGENT User\-Agent header sent by websockets. The default value uses the format .RB \(dq Python/x.y.z\ websockets/X.Y \(dq. .TP .B WEBSOCKETS_MAX_LINE_LENGTH Maximum length of the request or status line in the opening handshake. Default: .B 8192 bytes. .TP .B WEBSOCKETS_MAX_NUM_HEADERS Maximum number of HTTP headers in the opening handshake. Default: .BR 128 . .TP .B WEBSOCKETS_MAX_BODY_SIZE Maximum size of the body of an HTTP response in the opening handshake. Default: .B 1048576 bytes (1 MiB). .TP .B WEBSOCKETS_MAX_REDIRECTS Maximum number of redirects that the client follows. Default: .BR 10 . .SH EXAMPLES Connect to a server running on the local machine: .PP .RS .nf $ websockets ws://localhost:8765/ .fi .RE .SH SEE ALSO The full documentation for .B websockets is available at .BR https://websockets.readthedocs.io/ .