Repository navigation
Client and benchmarks
holyWisp ships a command-line client, holywisp-client, and the C library it is built on,
libholywisp-client. The client is netcat through a Wisp server: it opens one TCP or UDP stream
and relays stdin and stdout over it. With --bench it is an echo benchmark instead. The
bench/ directory of the repository holds the harness that compares holyWisp with other Wisp
servers, and its published results.
Every example on this page was run against a server, echo, sink and source on 127.0.0.1. Run the same only against servers and services you own.
The client is its own package, with no service, user or config file:
holywisp-client_<version>-<rev>_amd64.deb, holywisp-client-<version>-<rev>.fc41.x86_64.rpm, or the
holywisp-client-linux-x64.tar.gz and -linux-arm64 tarballs on the
latest release.
Install-and-run has the install commands. A source build makes it beside the
server (make release writes build/release/holywisp-client; see
Building-from-source).
It builds on Linux and macOS. It is not built for Windows, because it waits for stdin and the
socket in one poll(2) and a Windows console cannot do that (CMakeLists.txt). The library is
built on every platform, Windows included.
holywisp-client [options] HOST PORT
HOST and PORT are the remote the server should connect to. The server URL comes from -s
and defaults to ws://127.0.0.1:6001/.
printf 'GET / HTTP/1.0\r\nHost: example.org\r\n\r\n' \
| holywisp-client -s ws://127.0.0.1:6001/ example.org 80A TCP echo on port 5256, through a server on 5255, with -v to see the events:
$ printf 'hi\n' | holywisp-client -s ws://127.0.0.1:5255/ -v --v2 --idle-ms 300 127.0.0.1 5256
connected: wisp-v2, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 2048, motd: example motd
[stream 1] DATA 3 bytes
hi
The connected: line reports what the handshake settled: the Wisp version, the stream-0
CONTINUE window in packets, the lanes (WebTransport), the stream credit and upload credit windows
in bytes (0 when off), the server's stream limit (extension 0xE3, 0 when it named none) and the
MOTD. The MOTD is the server's bytes, so the client escapes every byte outside printable ASCII as
\xNN before it prints it.
A UDP stream, here to a UDP echo:
$ printf 'udp ping\n' | holywisp-client -s ws://127.0.0.1:5255/ --udp -v --idle-ms 300 127.0.0.1 5260
connected: wisp-v1, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 0
[stream 1] DATA 9 bytes
udp ping
A stream the server refuses ends with its close reason on stderr (with -v) and exit status 1:
$ printf 'x' | holywisp-client -s ws://127.0.0.1:5255/ -v 10.0.0.1 80
connected: wisp-v1, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 0
[stream 1] CLOSE host blocked (0x48)
$ printf 'x' | holywisp-client -s ws://127.0.0.1:5255/ -v 127.0.0.1 1
connected: wisp-v1, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 0
[stream 1] CLOSE connection refused (0x44)
0x48 is the egress policy (a private address, see Security-and-limits);
the other reasons are listed in Protocol.
| Event | Exit status |
|---|---|
The remote closed the stream (0x02) |
0 |
stdin reached end of file and nothing arrived for --idle-ms (2000 ms by default) |
0 |
| The stream closed with any other reason, or the server closed the connection | 1 |
| A send failed, or stdout could not be written | 1 |
| A usage error: unknown option, bad URL, bad port, bad pin | 2 |
The idle timer restarts each time something arrives after end of file, so a reply that is still
coming keeps the client running. A send that has no CONTINUE within 10 s does not fail: the
client writes out what arrived meanwhile and offers the same bytes again, as a pipe would wait
(-v prints still waiting for a CONTINUE).
--confirm asks a v2 server for a CONTINUE when the stream has connected (extension 0x05). It
carries the packets left in the stream's window, so it reads 127 when one packet was already sent
while the dial was in progress:
$ printf 'x\n' | holywisp-client -s ws://127.0.0.1:5255/ --confirm -v --idle-ms 300 127.0.0.1 5256
connected: wisp-v2, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 2048, motd: example motd
[stream 1] CONTINUE 127
[stream 1] DATA 2 bytes
x
| URL | Transport | Default port |
|---|---|---|
ws://host:port/path |
WebSocket over TCP, no TLS | 80 |
https://host:port/path |
WebTransport (HTTP/3 over QUIC, UDP) | 443 |
wss://... |
refused: wss:// is not supported; terminate TLS in front of the server
|
An IPv6 server address goes in brackets: ws://[::1]:6001/. The path defaults to /.
There is no TLS on the ws:// path. The v2 password and every byte of every stream cross the
network in clear, and anyone on the path can answer in the server's place. A public server sits
behind a TLS reverse proxy (Reverse-proxy), which this client cannot speak to
directly. To reach one from the command line, use its WebTransport listener if it has one, or a
TLS tunnel of your own on the client side whose far end does not route by Host (the client
sends the -s URL's host:port as Host).
-2 or --v2 offers the wisp-v2 subprotocol. The server speaks v2 when its enable-v2 is on
(the default). A server with enable-v2 off does not take it, and the client exits 1 with
server did not accept wisp-v2: it does not fall back to v1. These options turn v2 on by themselves:
--user, --confirm, --credit, --upload-credit, --lanes and --server-stream.
--user U sends a user name and password when the server's INFO asks for them (extension 0x02,
present when the server has a password-user). The password comes from one of three places:
| Source | Notes |
|---|---|
--pass-file F |
The first line of F, without its line ending. Refused when it is empty, holds a NUL byte, or is over 127 bytes, the limit of the password extension. |
$HOLYWISP_PASSWORD |
Read only with --user, and only when neither --pass nor --pass-file is given. |
--pass P |
On the command line, where every user of the host can read it in the process list. |
--pass and --pass-file together are a usage error. The user name is at most 255 bytes.
install -m 600 /dev/null ~/.wisp-pass && $EDITOR ~/.wisp-pass # one line: the password
holywisp-client -s ws://127.0.0.1:6001/ --user <user> --pass-file ~/.wisp-pass example.org 80A wrong password closes the connection:
$ printf 'hi\n' | HOLYWISP_PASSWORD=wrong holywisp-client -s ws://127.0.0.1:5255/ --user demo 127.0.0.1 5256
server closed: bad password (0xc0)
The client sends credentials only to a server that asked for them. When it did not, the client says so and goes on unauthenticated:
warning: the server did not ask for a password, so none was sent: not authenticated
A server with password-required closes an unauthenticated v2 client. Twisp terminal streams
need an authenticated v2 client (Security-and-limits); the command-line
client opens only TCP and UDP streams.
An https:// URL connects over WebTransport to the server's UDP listener (webtransport = on,
on the same port number as TCP unless webtransport-port says otherwise; see
WebTransport). The QUIC path is encrypted, but there is no certificate authority
check: a pin is the only thing that authenticates the server, so the client refuses to start
without one.
$ holywisp-client -s https://127.0.0.1:5255/ 127.0.0.1 5256
an https:// server needs --pin or --pin-key (or --insecure, which takes any certificate)
| Option | What it pins |
|---|---|
--pin HASH |
The certificate's SHA-256, base64 or 64 hex digits. For a server's own rotating certificate, take it from GET /webtransport.json on the server's TCP port. |
--pin-key HASH |
The SHA-256 of the certificate's public key (SubjectPublicKeyInfo), base64, hex or curl's sha256//base64. Up to 4, any one matching. It survives a renewal that keeps the key (certbot --reuse-key), so it fits an operator certificate. |
--insecure |
Takes any certificate. For loopback tests. |
With both --pin and --pin-key, both must hold.
Pinning a server's self-signed certificate:
$ curl -s http://127.0.0.1:5255/webtransport.json
{"url":"","hashes":[{"algorithm":"sha-256","value":"4HVwmghsTpNpDBAWOeXaorZCDXR9LV2ptYjBnEevsgU="}]}
$ printf 'over quic\n' | holywisp-client -s https://127.0.0.1:5255/ \
--pin 4HVwmghsTpNpDBAWOeXaorZCDXR9LV2ptYjBnEevsgU= -v --idle-ms 300 127.0.0.1 5256
connected: wisp-v1, window 128, 1 lane, stream credit 0, upload credit 0, stream limit 0
[stream 1] DATA 10 bytes
over quic
The server makes a new self-signed certificate at every start and every 6 days, so fetch the
hash again rather than keeping it. The value for --pin-key from a PEM certificate:
openssl x509 -in cert.pem -noout -pubkey | openssl pkey -pubin -outform der \
| openssl dgst -sha256 -binary | base64The other WebTransport options:
| Option | Default | What it does |
|---|---|---|
--origin ORIGIN |
none | Sends an origin header, for a server with allow-origin. |
--connect-to A |
the URL's host | Sends the datagrams to address or name A; the URL's host stays the SNI and :authority, as with curl's option of that name. Reaches one host of a server with webtransport-cert-dir by its address. Every address A resolves to is tried in turn. |
--lanes N |
1 | v2: ride up to N QUIC streams (lanes), the first included, when the server offers them (extension 0xE1). 0 to 16. Each CONNECT goes on the lane with the fewest open streams. |
--server-stream |
off | v2: offers wisp-v2-server-stream after wisp-v2, so a server that knows it opens the Wisp stream itself and sends its CONTINUE without waiting for the client's INFO. |
--udp-buffer N |
4 MiB | The UDP socket's receive and send buffers. 212992 receives as a browser does on a Linux with stock net.core.rmem_max, for testing a server's bursts against a small buffer. |
Using one of these with a ws:// URL is a usage error. UDP stream DATA goes as QUIC datagrams,
which can be lost as UDP would be.
$ holywisp-client -s https://127.0.0.1:5255/ --insecure --lanes 4 --server-stream \
--bench 268435456 --streams 4 -v 127.0.0.1 5256
connected: wisp-v2, window 128, 4 lanes, server-opened, stream credit 0, upload credit 0, stream limit 2048, motd: example motd
268435456 bytes echoed in 390 ms: 656.4 MiB/s each way, checksum ok
connect 1.8 ms, first byte 8.5 ms after the start
These change how the client and a v2 server pace a stream. Protocol describes the extensions; docs/extensions.md in the repository is their specification.
--credit BYTES asks for stream credit (extension 0xE2) with an initial window of BYTES per
stream. The server then sends each TCP stream only what the client has read plus one window. The
client sends a CREDIT once it has read half a window. Values from 1 to 4294967295 are accepted,
and a window under 16384 is taken as 16384. The server offers stream credit unless its
stream-credit is off.
--upload-credit asks for upload credit (extension 0xE4): the client's sends on each TCP
stream are counted in bytes against a limit that the server raises as its remote takes them,
instead of CONTINUE's window of packets. The server offers it unless its upload-credit is off.
--read-rate BPS reads what arrives no faster than BPS bytes a second. With --credit, that
holds the server, and the remote behind it, to that rate:
$ holywisp-client -s ws://127.0.0.1:5255/ --credit 65536 --read-rate 10485760 \
--bench 52428800 --download 127.0.0.1 5258
52428800 bytes received in 4995 ms: 10.0 MiB/s down
connect 0.4 ms, first byte 0.8 ms after the start
When the server does not offer what was asked for, the client warns and goes on:
warning: the server does not offer stream credit: --credit has no effect
warning: the server does not offer upload credit: --upload-credit has no effect
--bench BYTES replaces the relay with a throughput test over the same server and stream type.
There are three directions:
| Options | Far end at HOST:PORT | Measures | Done when |
|---|---|---|---|
--bench BYTES |
an echo service | both directions; a checksum of every byte sent and received | all BYTES came back |
--bench BYTES --upload |
a sink (discard) | uploads | the last chunk is sent; the CONTINUE window holds the sender to what the remote takes, to within one window |
--bench BYTES --download |
a source (chargen, bench/echo --source) |
downloads |
BYTES were received |
--streams N (1 to 1024, default 1) splits BYTES across N streams opened at once. BYTES is
rounded down to a multiple of N. Data goes in 64 KiB packets. --upload and --download
without --bench are a usage error. With --credit, an echo stream keeps at most half a window
in flight.
bench/echo.c in the repository gives you all three far ends on loopback. Build it on its own:
cc -O2 -pthread -o /tmp/echo bench/echo.c
/tmp/echo 5256 & # echo
/tmp/echo --sink 5257 & # reads and discards
/tmp/echo --source 5258 & # sends a pattern without being askedIt prints <monotonic ns> <bytes> <connections> on stdout every 100 ms; redirect it if you do
not want that.
Output from a release build on a 32-thread Linux workstation, server and services on loopback:
$ holywisp-client -s ws://127.0.0.1:5255/ --bench 268435456 127.0.0.1 5256
268435456 bytes echoed in 145 ms: 1765.5 MiB/s each way, checksum ok
connect 0.3 ms, first byte 2.1 ms after the start
$ holywisp-client -s ws://127.0.0.1:5255/ --bench 268435456 --upload 127.0.0.1 5257
268435456 bytes sent in 79 ms: 3240.5 MiB/s up
connect 0.3 ms
$ holywisp-client -s ws://127.0.0.1:5255/ --bench 268435456 --download 127.0.0.1 5258
268435456 bytes received in 48 ms: 5333.3 MiB/s down
connect 0.3 ms, first byte 1.0 ms after the start
The first line is the rate in MiB/s. checksum ok means the bytes that came back sum to the bytes
sent; MISMATCH exits 1. The second line is the time hw_client_connect took (TCP or QUIC
connect, upgrade and Wisp handshake) and the time from the start of the transfer to the first
byte back. A 256 MiB run is over in a fraction of a second on loopback; use 1 GiB or more for a
figure that does not move between runs. The client is one thread and checksums every byte that
comes back, so on a fast server it can be the limit: for numbers that compare servers, use the
harness below.
A run that gets no data for 10 s stops with timed out after N/M bytes; a stream that closes
stops with stream closed: <reason>. Both exit 1.
| Option | Default | Meaning |
|---|---|---|
-s, --server URL
|
ws://127.0.0.1:6001/ |
The Wisp server: ws:// or https:// (WebTransport). |
-u, --udp
|
TCP | Open a UDP stream. |
-2, --v2
|
v1 | Offer Wisp v2. |
--user U |
none | v2 password user; turns on v2. |
--pass-file F |
none | The password: the first line of F. |
--pass P |
none | The password on the command line (visible in the process list). |
--confirm |
off | v2: ask for a CONTINUE when a TCP stream connects. |
--idle-ms N |
2000 | After stdin's end of file, exit when nothing arrives for N ms. |
--bench BYTES |
off | Benchmark instead of relaying. |
--streams N |
1 | With --bench: streams at once, 1 to 1024. |
--upload |
off | With --bench: send to a sink. |
--download |
off | With --bench: read from a source. |
--credit BYTES |
off | v2: stream credit with this initial window per stream; under 16384 counts as 16384. |
--upload-credit |
off | v2: count uploads in bytes against the server's grants. |
--read-rate BPS |
off | Read no faster than BPS bytes a second. |
--pin HASH |
none | WebTransport: the certificate's SHA-256. |
--pin-key HASH |
none | WebTransport: the public key's SHA-256, up to 4 times. |
--insecure |
off | WebTransport: take any certificate. |
--origin ORIGIN |
none | WebTransport: send an origin header. |
--connect-to A |
URL host | WebTransport: connect to A, keep the URL's host as SNI. |
--lanes N |
1 | WebTransport v2: up to N lanes, 0 to 16. |
--server-stream |
off | WebTransport v2: ask the server to open the Wisp stream. |
--udp-buffer N |
4 MiB | WebTransport: UDP socket buffers in bytes. |
-v, --verbose
|
off | Print the handshake and every event on stderr. |
-h, --help
|
Print the usage and exit 0. |
Options and the two positional arguments may come in any order. Environment: HOLYWISP_PASSWORD.
include/holywisp/client.h is a blocking, single-threaded Wisp client. One hw_client is one
WebSocket connection, or one WebTransport session with opts.webtransport, carrying any number
of streams. The caller drives it with hw_client_poll. Events for one stream that arrive while a
call waits for another are queued and handed out in order.
The library is not installed by the packages. Build the tree (make release) and link the static
libraries from build/release/, in this order:
R=path/to/holyWisp/build/release
cc -O2 -I path/to/holyWisp/include -o fetch fetch.c \
$R/libholywisp-client.a $R/libhw_wt.a $R/libhw_quic.a $R/libhw_quic_wire.a $R/libhw_tls.a \
$R/libhw_crypto_asym.a $R/libhw_crypto_sym.a $R/libholywisp.a -lpthread -lutilThe client library does not need libcrypt (only the server checks password hashes). On macOS drop -lutil. The CMake target holywisp-client links the same libraries, but
it also passes the project's warning flags and -Werror (the hw_flags interface target in
CMakeLists.txt) to everything that links it, so a program outside the tree is simpler to link by
hand as above.
This opens a TCP stream to an echo on 127.0.0.1:5256 through a server on 127.0.0.1:5255, sends a line and prints the reply. It compiled and ran with the link line above.
#include <holywisp/client.h>
#include <holywisp/hw.h>
#include <holywisp/wisp.h>
#include <stdio.h>
#include <string.h>
int main(void) {
hw_client_opts o;
hw_client_opts_defaults(&o); // ws://127.0.0.1:6001/, 10 s timeout
o.port = 5255;
o.v2 = 1;
char err[256];
hw_client *c = hw_client_connect(&o, err, sizeof err);
if (!c) {
fprintf(stderr, "connect: %s\n", err);
return 1;
}
uint32_t sid;
if (hw_client_open(c, HW_STREAM_TCP, "127.0.0.1", 5256, &sid) != 0) return 1;
const char msg[] = "hello from the library\n";
if (hw_client_send(c, sid, msg, sizeof msg - 1) != 0) return 1;
hw_client_event ev;
while (hw_client_poll(c, 2000, &ev) > 0) {
if (ev.type == HW_CEV_DATA && ev.stream_id == sid) {
fwrite(ev.data, 1, ev.len, stdout);
break;
}
if (ev.type == HW_CEV_CLOSE) {
fprintf(stderr, "closed: %s\n", hw_close_reason_str(ev.reason));
break;
}
}
hw_client_close_stream(c, sid, HW_CLOSE_VOLUNTARY);
hw_client_free(c);
return 0;
}ev.data is valid until the next call on the client. A stream type is HW_STREAM_TCP,
HW_STREAM_UDP or HW_STREAM_TERM (Twisp), from holywisp/wisp.h.
hw_client_opts_defaults fills in the defaults; set only what differs.
| Field | Default | Meaning |
|---|---|---|
host, port, path
|
127.0.0.1, 6001, /
|
The server. With webtransport, port is the UDP port and path the session's :path. |
v2 |
0 | Offer wisp-v2. A server that answers with a subprotocol the client did not offer is refused. |
user, pass
|
NULL | v2 password, at most 255 and 127 bytes, sent only when the server's INFO asks. |
stream_confirm |
0 | v2: ask for a CONTINUE when a TCP stream connects. |
timeout_ms |
10000 | One bound for hw_client_connect as a whole, and the longest hw_client_send waits for a CONTINUE. Negative waits without bound. |
max_message |
1 MiB + 5 | Largest WebSocket message accepted from the server. |
max_queue_bytes, max_queue_events
|
32 MiB, 65536 | The most the client holds in queued events. 0 means the default. |
webtransport |
0 | WebTransport instead of a WebSocket. |
pin_sha256 |
NULL | 32 bytes the certificate must hash to. NULL with no key pins takes any certificate. |
key_pins_sha256, key_pin_count
|
NULL, 0 | Up to HW_TLS_KEY_PINS_MAX (4) public key hashes, back to back. |
origin |
NULL | The origin header to send. |
server_name |
NULL | WebTransport: SNI and :authority host when host is only where to connect. |
wt_server_stream |
0 | WebTransport v2: offer wisp-v2-server-stream. |
wt_lanes |
0 | WebTransport v2: up to this many lanes, 16 at most; 0 or 1 is lane 0 alone. |
credit_window |
0 | Stream credit with this initial window in bytes; a window under 16384 counts as 16384, on both ends. |
credit_manual |
0 | With credit_window: the library grants nothing itself; the caller calls hw_client_credit. |
upload_credit |
0 | Name upload credit (0xE4) when the server offers it. |
wt_udp_buffer |
0 (4 MiB) | WebTransport: UDP socket buffers. |
| Function | Returns |
|---|---|
hw_client_connect(o, err, cap) |
A client, or NULL with a printable ASCII message in err. Connects, upgrades and completes the Wisp handshake. |
hw_client_free(c) |
Closes and frees. |
hw_client_open(c, type, host, port, &id) |
0 with the stream id; HW_ERR_INVALID for an empty host or one over 255 bytes (a HW_STREAM_TERM command line may have 4096); HW_ERR_TOOBIG when the server's stream limit is reached (nothing is sent). |
hw_client_send(c, id, data, len) |
Sends one DATA packet, waiting up to timeout_ms for a CONTINUE (or upload credit grant) when the window is spent. 0; HW_ERR_TIMEOUT with nothing sent, the client intact; HW_ERR_CLOSED; HW_ERR_TOOBIG when the queue filled during the wait, which closes the client. |
hw_client_try_send(c, id, data, len) |
The same without waiting: HW_ERR_AGAIN with nothing sent when the window is spent, the WebTransport send queue is full, or an earlier frame is still partly unsent. |
hw_client_unsent(c), hw_client_flush(c)
|
Bytes of a frame try_send began that the socket has not taken; write more of them (0, HW_ERR_AGAIN, HW_ERR_CLOSED). |
hw_client_window(c, id, &packets) |
DATA packets the stream may send before the next CONTINUE (UINT32_MAX for UDP). |
hw_client_poll(c, timeout_ms, &ev) |
1 with an event, 0 on timeout, HW_ERR_CLOSED, HW_ERR_PROTOCOL. -1 waits forever. PING, PONG and INFO do not extend the timeout. |
hw_client_read_exact(c, id, out, want, timeout_ms) |
For tests: waits for exactly want bytes on one stream; fewer when the stream closed or time ran out. |
hw_client_close_stream(c, id, reason) |
Sends CLOSE. |
hw_client_credit(c, id, limit) |
Sends CREDIT: the server may have sent the stream limit bytes in all. HW_ERR_INVALID when stream credit is off. |
hw_client_fd(c) |
The socket, for poll(2) beside other descriptors. |
hw_client_wait_ms(c), hw_client_wait_us(c)
|
The longest a caller may wait before calling hw_client_poll: QUIC's timers run only inside the client's calls. -1 on a WebSocket. |
hw_client_is_v2, hw_client_authenticated, hw_client_motd, hw_client_server_has_udp, hw_client_server_has_stream_confirm, hw_client_max_streams, hw_client_buffer_size, hw_client_credit_window, hw_client_upload_window, hw_client_lanes, hw_client_stream_lane, hw_client_server_stream
|
What the handshake settled. |
hw_client_printable(out, cap, data, len) |
Copies bytes as printable ASCII, every other byte as \xNN. |
Events have type HW_CEV_DATA (data, len), HW_CEV_CLOSE (reason) or HW_CEV_CONTINUE
(buffer_remaining), and the stream_id they belong to. A CLOSE on stream 0 is the server
ending the connection. Error codes are in holywisp/hw.h; hw_close_reason_str in
holywisp/wisp.h names a close reason.
The server is not trusted. Every length it sends is checked against max_message,
max_queue_bytes and max_queue_events, and every wait runs against one deadline per call that
nothing the server sends can restart. Writes are the exception: the socket is blocking, so a
server that stops reading can hold a call that sends for as long as it keeps the connection open.
hw_client_try_send never waits.
hw_client_authenticated returns 0 when no credentials were sent, which includes a server that
did not ask for them. A caller that requires authentication checks it and hangs up.
The MOTD and any server text quoted in an error are the server's bytes. Pass them through
hw_client_printable before writing them to a terminal or a log.
A caller with its own event loop polls hw_client_fd, waits no longer than hw_client_wait_us
(or hw_client_wait_ms) on WebTransport, and calls hw_client_poll(c, 0, &ev) until it returns
0. It sends with hw_client_try_send, and on HW_ERR_AGAIN either polls for reading (a CONTINUE
is due) or, while hw_client_unsent is not 0, polls for writing and calls hw_client_flush.
The repository's tests/test_e2e.c, tests/test_e2e_wt.c and tests/test_security.c use every function above, and the client's own src/client/main.c is a complete program on top of it.
bench/ compares holyWisp with
other Wisp servers the way wispmark does: a TCP echo
on loopback, one server at a time in front of it, clients pushing data through Wisp streams to
the echo port. The figure is bytes per second across the echo port in one direction, counted by
the echo service itself, so it does not depend on which client made the traffic. The harness also
records the server's CPU time and memory, round-trip latency and how fast a server opens and
closes streams. None of it runs in make test.
| File | What it is |
|---|---|
bench/echo.c |
The counting echo. Prints ns bytes conns every 100 ms. echo [--sink | --source] PORT [COUNT]: with COUNT it listens on PORT to PORT+COUNT-1 and counts them together. |
bench/pump.c |
The native load generator, on libholywisp-client. Prints one JSON line. |
bench/run.py |
Starts servers and clients, measures, writes the results. |
bench/charts.py |
Charts and an HTML report from a results directory. |
bench/test_run.py |
Unit tests for the harness: python3 -I -m unittest discover -s bench -p test_run.py. |
bench/configs/ |
The configs for wispurr (Go and C++23) and epoxy-server. |
make bench # release build, then build/bench/echo and build/bench/pumppump [-s ws://127.0.0.1:6001/ | -s https://HOST:PORT/] [--pin B64|HEX] [--pin-key B64|HEX]
[--insecure] [--v2] --mode tp|up|down|rtt|churn [--streams N] [--duration S]
[--chunk BYTES] [--inflight BYTES|K] [--settle-ms N] HOST PORT
| Mode | Far end | What it does |
|---|---|---|
tp (default) |
echo | Keeps --streams TCP streams full for --duration seconds within the CONTINUE window and a per-stream in-flight cap (--inflight, 4 MiB). mib_s is bytes received. |
up |
echo --sink |
The same toward a sink; only the window holds a stream back. mib_s is bytes sent. |
down |
echo --source |
Reads --streams streams from a source. |
rtt |
echo | One stream, one message in flight (--chunk, 64 bytes in this mode). Latency percentiles. |
churn |
echo | Keeps --inflight streams (32, at most 256) in flight: open, echo one byte, close, open another. |
--streams is 1 to 256 (default 1), --duration 10 s, --chunk 64 KiB. --settle-ms waits
after opening the streams before the clock starts. An https:// URL needs --pin, --pin-key
or --insecure. Real output on loopback:
{"mode":"tp","streams":4,"elapsed_us":3000013,"sent":4512743424,"received":4496179607,"window":128,"mib_s":1429.29,"stalls":0,"stalled_at_us":0,"connect_us":216,"first_byte_us":2382}
{"mode":"down","streams":1,"elapsed_us":2000004,"received":5793153241,"mib_s":2762.39,"stalls":0,"connect_us":246,"first_byte_us":745}
{"mode":"rtt","bytes":64,"elapsed_us":2000003,"count":53766,"mean_us":36.61,"p50_us":34,"p90_us":43,"p99_us":67,"p999_us":389,"max_us":1680,"rps":26883.0,"stalls":0,"connect_us":248}
{"mode":"churn","inflight":32,"elapsed_us":2000058,"completed":38955,"failed":0,"per_s":19476.9,"open_p50_us":1567,"open_p99_us":2638,"connect_us":246}
connect_us is the connect and Wisp handshake. first_byte_us is from the first send (for
down, the CONNECTs) to the first byte back. stalls counts the times every stream had spent
its window and the server sent nothing for 2 s; stalled_at_us is when the first one happened.
open_p50_us and open_p99_us are CONNECT to echoed byte.
A server with its default limits is the wrong target for churn: tens of thousands of streams a
second from one address trip the flood limits, and then reputation refuses the address at upgrade
(pump: send failed, then connect failed: server answered 403). The harness starts holyWisp with
--flood-protection=off --reputation=off --connections-limit-per-ip=0 --connection-window-s=0
beside --allow-loopback=on --allow-direct-ip=on. Security-and-limits
describes those limits.
make bench
python3 -I bench/run.py --duration 10 --repeats 12 --out bench/results/full
python3 -I bench/charts.py bench/results/full --png| Option | Default | Meaning |
|---|---|---|
--duration S |
10 | Seconds per measurement. |
--repeats N |
3 | Runs per server and scenario; the tables show the median. |
--only A,B |
every server except holywisp-exp and holywisp-sockbuf
|
Servers to run. |
--scenarios A,B |
all | Scenarios to run. |
--out DIR |
bench/results/<timestamp> |
Where the results go. |
--replace |
off | With --only: re-run those servers and splice them into an existing --out. |
--any-cpus |
off | Run on a host without 8 CPUs. Its numbers compare with nothing. |
--memory-cgroup DIR |
this process's cgroup | cgroup v2 directory to watch. |
--memory-limit-mib N |
the cgroup's | Memory ceiling, when a container hides its parent's limit. |
The harness refuses to start unless the host has exactly 8 CPUs, both online and in its affinity
mask. Every server starts one worker per CPU it sees, and holyWisp and wisp-server-python count
online CPUs, not their affinity, so taskset on a bigger machine does not work: use an 8-CPU VM
or container. The server listens on 16401 and the echo on 16402 (and up, for churn).
The scenarios:
| Name | Client |
|---|---|
wispjs-10 |
wispmark's wisp-js client, 1 connection, 10 streams |
wispjs-5x10 |
wisp-js, 5 connections of 10 streams |
native-1, native-10
|
pump --mode tp, 1 connection, 1 or 10 streams |
native-10-1m |
pump --mode tp, 10 streams, 1 MiB packets |
native-8x4 |
8 pump processes of 4 streams |
rtt-64 |
pump --mode rtt, 64 B |
churn-8x32 |
8 pump processes, 32 streams in flight each, each against its own echo port |
The servers it knows are holyWisp (build/release/holywisp), wispurr in Go and C++23,
finalwisp, epoxy-server and wisp-server-python, each in a sibling checkout of the holyWisp tree;
bench/README.md has the build notes for each. Within a scenario the servers run one after another
and the order rotates each repeat, so use a repeat count that is a multiple of the number of
servers (12 for six, which gives every server every slot twice).
A run writes results.json (with every command line under meta), runs.jsonl, results.csv,
results.md and per-run logs under logs/. charts.py writes charts/*.svg in light and dark
and report.html; --png rasterises the SVGs with headless Chromium. The harness stops a run if
memory reaches 85% of the limit or the cgroup reports memory pressure, and rejects a sample whose
echo and wall-clock intervals disagree. DNF in a table means no byte reached the echo port, or a
client exited with an error; the reason is in runs.jsonl and logs/.
bench/RESULTS.md is the run of 2026-11-18: holyWisp 0.5.4, twelve repeats of 10 s, in an 8-CPU Debian 13 container (four AMD Ryzen 9 7950X cores with both hardware threads) that the servers, clients and echo shared. Throughput in MiB/s through the echo port, median:
| Server | wisp-js, 10 streams | wisp-js, 5 x 10 | native, 1 stream | native, 10 streams | native, 10 x 1 MiB packets | native, 8 x 4 |
|---|---|---|---|---|---|---|
| holyWisp (C11) | 1,325 | 2,225 | 3,813 | 3,462 | 3,005 | 4,466 |
| finalwisp (Rust) | 1,380 | 2,029 | 3,532 | 3,256 | 3,537 | 4,705 |
| wispurr (C++23) | 1,091 | 1,792 | 3,861 | 3,274 | 2,985 | 3,700 |
| wispurr (Go) | 1,192 | 1,460 | 2,603 | 2,427 | 2,545 | 2,002 |
| epoxy-server (Rust) | 732 | 1,265 | 994 | 1,003 | 1,127 | 3,073 |
| wisp-server-python | 800 | 1,132 | 767 | 839 | DNF | 2,024 |
The same file has the CPU cores each server kept busy, MiB relayed per CPU-second, the 64 B round trip (holyWisp 24.5 us median, 35 us at p99) and stream churn (holyWisp 114,439 lifecycles a second at 3.72 MiB peak RSS). Differences of a few percent within a row are noise; numbers from different hosts do not compare.
| Symptom | Cause and fix |
|---|---|
an https:// server needs --pin or --pin-key |
WebTransport without a pin. Take --pin from the server's /webtransport.json, or --pin-key from its certificate. |
--pin, --pin-key, ... are for an https:// (WebTransport) server |
A WebTransport option with a ws:// URL. |
server did not accept wisp-v2 |
A v2 option against a server with enable-v2 off. Drop --v2 and the options that imply it. |
wss:// is not supported |
The client has no TLS on the WebSocket path. See the server URL. |
connect 127.0.0.1:6001: Connection refused |
No server on that port; the default URL is ws://127.0.0.1:6001/. |
bad upgrade response: HTTP/1.1 429 Too Many Requests... (or 403) |
The server refused the upgrade: per-IP connect rate or connection limits (429), reputation or the origin list (403). See Troubleshooting. |
server closed: bad password (0xc0) |
Wrong password, or the first line of --pass-file is not the password. |
CLOSE host blocked (0x48) |
The server's egress policy refused the target, often a loopback or private address. |
send failed: no CONTINUE from the server in time (bench) |
The server held its CONTINUE for 10 s, usually because the remote is not reading. In relay mode the client keeps waiting instead. |
timed out after N/M bytes (bench) |
Nothing arrived for 10 s: the far end is not an echo (or not a source, with --download). |
checksum MISMATCH |
Bytes came back different from what was sent. The far end is not a plain echo. |
| Bench numbers far below the tables above | A Debug build (ASan) runs several times slower: use build/release. On loopback a release build relays hundreds of MiB/s or more. |
Checked against commit db9d9e8 on master of Fracital/holyWisp. Where a page and the code disagree, the code is right.
Getting started
Running a server
- Configuration
- Reverse proxy
- Security and limits
- Stats and monitoring
- Running in production
- Troubleshooting
Features
Clients
Releases