haproxy/dev
Willy Tarreau 607aa57b2e DEV: h2: add a Lua-based HTTP/2 connection tracer
The following config is sufficient to trace H2 exchanges between a client
and a server:

   global
       lua-load "dev/h2/h2-tracer.lua"

   listen h2_sniffer
       mode tcp
       bind :8002
       filter lua.h2-tracer #hex
       server s1 127.0.0.1:8003

The commented "hex" argument will also display full frames in hex (not
recommended). The connections are prefixed with a 3-hex digit number in
order to also support a bit of multiplexing without impacting the reading
too much. The screen is split in two, with the request on the left and
the response on the right. Here's an example of what it does between an
haproxy backend and an haproxy frontend both in H2, when submitted a
curl request for /?s=30k handled by httpterm:

  [001] ### req start
  [001] [PREFACE len=24]
  [001] [SETTINGS sid=0 len=24 (bytes=24)]
  [001]                                          | ### res start
  [001]                                          | [SETTINGS sid=0 len=18 (bytes=27)]
  [001]                                          | [SETTINGS ACK sid=0 len=0 (bytes=0)]
  [001] [SETTINGS ACK sid=0 len=0 (bytes=56)]
  [001] [HEADERS EH+ES sid=1 len=47 (bytes=47)]
  [001]                                          | [HEADERS EH sid=1 len=101 (bytes=15351)]
  [001]                                          | [DATA sid=1 len=15126 (bytes=15241)]
  [001]                                          | [DATA sid=1 len=1258 (bytes=106)]
  [001]                                          |                  ... -106 = 1152
  [001]                                          |                    ... -1152 = 0
  [001] [WINDOW_UPDATE sid=1 len=4 (bytes=43)]
  [001] [WINDOW_UPDATE sid=0 len=4 (bytes=30)]
  [001] [WINDOW_UPDATE sid=1 len=4 (bytes=17)]
  [001] [WINDOW_UPDATE sid=0 len=4 (bytes=4)]
  [001]                                          | [DATA ES sid=1 len=14336 (bytes=14336)]
  [001] [WINDOW_UPDATE sid=0 len=4 (bytes=4)]
  [001] ### req end: 31080 bytes total
  [001]                                          | [GOAWAY sid=0 len=8 (bytes=8)]
  [001]                                          | ### res end: 31097 bytes total

It deserves some improvements. For instance at the moment it does not
verify the preface, any 24 bytes will work. It does not perform any
protocol validation either. Detecting some issues such as out-of-sequence
frames could be helpful. But it already helps as-is.
2025-02-18 09:26:15 +01:00
..
base64 CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
coccinelle DEV: coccinelle: add a test to detect unchecked calloc() 2024-08-24 19:13:56 +02:00
flags DEV: lags/show-sess-to-flags: Properly handle fd state on server side 2024-11-25 21:57:30 +01:00
gdb DEV: gdb: add a number of gdb scripts to navigate in core dumps 2024-10-28 17:55:08 +01:00
h2 DEV: h2: add a Lua-based HTTP/2 connection tracer 2025-02-18 09:26:15 +01:00
haring MEDIUM: ring: use the topmost bit of the tail as a lock 2024-03-25 17:34:19 +00:00
hpack DEV: hpack: fix trash build regression 2023-01-27 10:22:20 +01:00
ncpu DEV: ncpu: make the wrapper work both as a lib and executable 2025-01-08 11:27:10 +01:00
patchbot DEV: patchbot: prepare for new version 3.2-dev 2024-11-26 17:24:21 +01:00
phash DEV: phash: Update 414 and 431 status codes to phash 2024-11-19 15:29:40 +01:00
plug_qdisc CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
poll DEV: poll: add support for epoll 2022-11-25 17:07:22 +01:00
qpack MINOR: qpack: implement standalone decoder tool 2022-06-15 15:42:10 +02:00
sslkeylogger DEV: sslkeylogger: handle file opening error 2023-10-03 15:23:35 +02:00
tcploop DEV: tcploop: add minimal support for unix sockets 2023-01-11 11:27:20 +01:00
term_events MINOR: tevt/dev: Parse tuple of termination events 2025-01-31 10:46:08 +01:00
trace CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
udp BUILD: address a few remaining calloc(size, n) cases 2024-02-10 11:37:27 +01:00