Websocat1 features missing in Websocat4
Websocat4 is a full rewrite of Websocat1. It makes it impractical to implement all the features accumulated in Websocat1 at the same time.
This issue tracks status of porting Websocat1 features to Websocat4 and allows voting using Github comment reactions to determine the priority. Each list entry links to a comment where you are expected to put reactions to attract my attention to a particular missing feature.
The list is styled as a websocat --help=full output converted to a checkboxed list. Checked items means the feature is already implemented in Websocat4.
Flags
- [x]
--stdout-announce-listening-ports - [ ]
--async-stdio - [ ]
--compress-deflate - [ ]
--compress-gzip - [ ]
--compress-zlib - [ ]
--crypto-reverse - [x]
--dump-spec - [ ]
-e, --set-environment - [x]
-E, --exit-on-eof - [ ]
--foreachmsg-wait-read - [ ]
--jsonrpc - [ ]
--jsonrpc-omit-jsonrpc - [ ]
--just-generate-key - [x]
--lengthprefixed-little-endian - [x]
--lengthprefixed-skip-read-direction - [x]
--lengthprefixed-skip-write-direction - [ ]
--linemode-strip-newlines - [x]
-0, --null-terminated - [ ]
--no-line - [ ]
--no-exit-on-zeromsg - [x]
--no-fixups - [ ]
--no-async-stdio - [ ]
-1, --one-message - [x]
--oneshot - [ ]
--print-ping-rtts - [ ]
--exec-exit-on-disconnect - [ ]
--exec-sighup-on-stdin-close - [ ]
--exec-sighup-on-zero-msg - [ ]
-q - [ ]
--reuser-send-zero-msg-on-disconnect - [x]
-s, --server-mode(but the latter is named just--serverinstead of--server-mode) - [ ]
-S, --strict - [ ]
--timestamp-monotonic - [x]
-k, --insecure - [ ]
--udp-broadcast - [ ]
--udp-multicast-loop - [ ]
--udp-broadcast - [ ]
--udp-oneshot - [ ]
--udp-reuseaddr - [ ]
--uncompress-deflate - [ ]
--uncompress-gzip - [ ]
--uncompress-zlib - [x]
-u, --unidirectional - [x]
-U, --unidirectional-reverse - [x]
--accept-from-fd - [x]
--unlink - [x]
-V, --version - [ ]
-v - [x]
-b, --binary - [x]
-n, --no-close - [ ]
--websocket-ignore-zeromsg - [x]
-t, --text - [ ]
--base64 - [ ]
--base64-text
Options
- [ ]
--socks5 - [ ]
--autoreconnect-delay-millis - [ ]
--basic-auth - [ ]
--basic-auth-file - [ ]
--queue-len - [x]
-B, --buffer-size- note that buffer size does not limit maximum message size in Websocat4 - [ ]
--byte-to-exit-on - [ ]
--client-pkcs12-der - [ ]
--client-pkcs12-passwd - [ ]
--close-reason - [ ]
--close-status-code - [ ]
--crypto-key - [x]
-H, --header - [x]
--server-header - [x]
--exec-args - [ ]
--header-to-env - [x]
-h, --help - [ ]
--help=short - [ ]
--help=doc - [x]
--inhibit-pongs - [ ]
--just-generate-accept - [x]
--lengthprefixed-nbytes - [ ]
--max-messages - [ ]
--max-messages-rev - [ ]
--conncap - [ ]
--max-sent-pings - [ ]
--max-ws-frame-length - [ ]
--max-ws-message-length - [x]
--origin - [ ]
--pkcs12-der - [ ]
--pkcs12-passwd - [ ]
-p, --preamble - [ ]
-P, --preamble-reverse - [ ]
--prometheus - [ ]
--request-header - [ ]
-X, --request-method - [ ]
--request-uri - [ ]
--restrict-uri - [ ]
-F, --static-file - [ ]
--socks5-bind-script - [ ]
--socks5-user-pass - [ ]
--socks5-destination - [x]
--tls-domain - [ ]
--udp-multicast - [ ]
--udp-multicast-iface-v4 - [ ]
--udp-multicast-iface-v6 - [ ]
--udp-ttl - [x]
--ua - [x]
--protocol - [x]
--server-protocol - [ ]
--websocket-version - [ ]
--binary-prefix - [x]
--ws-c-uri - [ ]
--ping-interval - [ ]
--ping-timeout - [ ]
--text-prefix
Endpoints
- [x]
ws:// - [x]
wss:// - [x]
ws-listen: - [ ]
inetd-ws: - [ ]
l-ws-unix: - [ ]
l-ws-abstract: - [x]
ws-lowlevel-client: - [x]
ws-lowlevel-server: - [ ]
wss-listen: - [ ]
http: - [ ]
asyncstdio: - [ ]
inetd: - [x]
tcp: - [x]
tcp-listen: - [ ]
ssl-listen: - [x]
sh-c: - [x]
cmd: - [x]
exec: - [x]
readfile: - [x]
writefile: - [x]
appendfile: - [x]
udp: - [x]
udp-listen: - [ ]
open-async: - [x]
open-fd: - [ ]
threadedstdio: - [x]
- - [x]
unix: - [x]
unix-listen: - [ ]
unix-dgram: - [x]
abstract: - [x]
abstract-listen: - [ ]
abstract-dgram: - [ ]
mirror: - [ ]
literalreply: - [ ]
clogged: - [x]
literal: - [ ]
assert: - [ ]
assert2: - [x]
seqpacket: - [x]
seqpacket-listen: - [x]
random: - [ ]
namedpipeconnect:
Overlays
- [x]
ws-upgrade: - [ ]
http-request: - [ ]
http-post-sse: - [x]
ssl-connect: - [ ]
ssl-accept: - [x]
reuse-raw: - [ ]
broadcast: - [ ]
autoreconnect: - [x]
ws-c: - [ ]
msg2line: - [ ]
line2msg: - [x]
lengthprefixed: - [ ]
foreachmsg: - [x]
log - [ ]
jsonrpc: - [ ]
timestamp: - [ ]
socks5-connect: - [ ]
socks5-bind: - [ ]
crypto: - [ ]
prometheus: - [ ]
exit_on_specific_byte: - [ ]
drop_on_backpressure: - [ ]
waitfordata:
Misc
- [ ] Lints
- [ ] Examples in
doc.md
Websocat1 can print a line on stdout when a listening port is ready to accept a connection.
Example:
$ /opt/websocat --stdout-announce-listening-ports -bE ws-l:127.0.0.1:1234 mirror:
LISTEN proto=tcp,ip=127.0.0.1,port=1234
Implemented in 4.0.0-alpha2.
Websocat1 can use stdin/stdout in nonblocking mode, providing simpler code path and increased efficiency in some scenarios at the cost of increased probability of some bugs.
This is especially useful if stdin/stdout is known to be not a terminal and not a regular file.
This point also tracks ability to open arbitrary files (or inherit file descriptors) as async devices.
Some things are implemented in 4.0.0-alpha2.
Websocat1 can decompress the data coming from a WebSocket or compress it before writing to a WebSocket. This is unrelated to permessage-deflate.
Websocat1 (max edition) contains a simple ad-hoc way to encrypt/obfuscate messages using a key (without IVs).
Websocat1 can set special environment variables when starting subprocesses with exec:/cmd:/sh-c: that depend on incoming client socket address or used request URL.
Websocat1 can turn each message into a new connection (that sends one message, possibly receives one message in reply).
This includes the --foreachmsg-wait-read mode.
Websocat1 can turn each line like QQQ www into a JSON snippet like {"jsonrpc":"2.0","id":1, "method":"QQQ", "params":[www]}, which can provide some convenience to interact with some services like Chromium's remotely controlled mode from terminal.
Instead of normal operation, Websocat1 can just print a Sec-Websocket-Key or Sec-Websocket-Accept header values, to aid implementing hacky Websocket upgrades using other tools.
Websocat1 can convert packets to byte stream (and back) using binary length-prefixed format where you can specify the length of the length field.
Implemented in 4.0.0-alpha2.
Websocat1 contains some tricks to adjust trailing newlines in WebSocket messages.
Websocat1 can be configured to use zero byte instead of newline to separate messages in a byte stream.
Websocat4 can as well with --separator 0, but specifically -0 or --null-terminated is not yet recognized as an alias to --separator 0 at the moment.
Implemented in 4.0.0-alpha2.
Websocat4 and Websocat1 have different architectural decisions regarding to how to connect bytestream-oriented and datagram-oriented sockets (where a WebSocket counts as datagram-orinted). This makes direct port of --no-line impractical, but similar effect may be imitated using other means, such as using chunks: instead of lines: even in text mode.
Websocat4 should not exit on zero-length messages by default (except of with seqpacket:, for which it may cause the recipient to exit), so --no-exit-on-zeromsg may be less applicable. A dummy option may be added for compatibility.
Like Websocat1, Websocat4 applies automatic transformations to the arguments you use. --no-fixups may be added to inhibit this step, which would typically lead to errors, unlike in Websocat1 where it led to possible suboptimal operation.
Implemented in 4.0.0-alpha2.
Websocat1 contains a mode where it automatically closes the connection after a single message. Such overlay can easily be added to Websocat4 (though it would work only with datagram-oriended Sockets).
This also extends to a non-one (but fixed) number of messages.
Like Websocat1, Websocat4 attempts to serve multiple connections (including in parallel) when you specify a listening socket at the left side.
However, --oneshot option to explicitly limit it to one connection is not yet supported (but can be added reasonable easily).
Specifying listener at the right side, unlike in Websocat1, leads to errors instead of being a --oneshot analogue.
Implemented in 4.0.0-alpha2.
Both Websocat1 and Websocat4 reply to pings, but Websocat1 can also send pings periodically. This includes additional features like printing RTTs for resulting pong replies or stopping outgoing pings after some moment.
Aborting connection on ping timeouts is also in scope of this point.
Websocat1's subprocess executors typically waits for child process termination before considering connection as really closed.
Websocat4's subprocess module is currently simpler in this regard. --exec-exit-on-disconnect-like behaviour may be default now, but if there will be refinements in this regard, the option may need to reappear.
On UNIX-like platforms, Websocat1's subprocess executor can send SIGHUP to processes when associated connection gets closed. In Websocat4 it is not yet implemented (maybe the process is just killed instead, maybe it dangles).
Websocat1 have -v and -q to affect verbosity of diagnostic output. Websocat4 has RUST_LOG support, but no relevant CLI options at the moment.
Making non-debug, user-friendly logs is not in scope of this point, just the options to affect verbosity.
Websocat1 contains reuse-broadcast: (alias reuse:) and reuse-raw: overlays. Websocat4 does not yet.
This includes various additional options that affect details of reuser behaviour.
reuse-raw: implemented in 4.0.0-alpha2.
Unlike Websocat1, Websocat4 makes use of WebSocket continuation frames and does not need to cache the whole message in memory, so buffer size should not affect maximum line length.
Lines that does not end with the separator are still processed. --strict may be reintroduced to drop such potentially chopped lines with a warning instead of sending them.
Websocat1 contains timestamp: overlay that modifies messages, adding a numeric timestamp before each message.
Websocat1 can set various UDP socket options, allowing to use broadcasts, multicasts, set TTL.
--udp-oneshot may be less relevant for Websocat4, given it has new udp-server: mode, if --one-message gets implemented.
Instead of binding a TCP socket, Websocat1 can accept connections from an inherited file descriptor (e.g. from SystemD).
Implemented in 4.0.0-alpha2.
Websocat1 has explicit option to inhibit zero-length WebSocket messages, which can cause problems, e.g. an abort in a seqpacket: connection.
Websocat1 can base64-encode binary messages before printing (or base64-decode input messages before sending).
If needed, this can extend to text messages.
Websocat1 can use SOCKS5 proxies.
Note that listening for incoming connections over SOCKS5 proxy is tracked as a separate comment below.
Websocat1 has autoreconnect: overlay that allows to retry underlying connection without breaking upstream connection.