Le 29/09/2026 à 11:12 AM, Stephan, Alexander a écrit :
Hi list,
This series adds a new SPOE event, "on-frontend-tcp-request-done", which
fires on the frontend after the "tcp-request content" rules have been
evaluated but before the "use_backend" switching rules. This lets an SPOA
agent inspect the buffered request and influence backend selection, for
example by setting a variable that a "use_backend" rule then reads.
The motivating use case is SNI-based routing in TCP mode: waiting for the
request via "tcp-request inspect-delay" + "tcp-request content", handing
req.ssl_sni to an agent, and letting the agent's reply pick the backend.
The event is hooked on the AN_REQ_SWITCHING_RULES analyzer through the
filter pre-analyze callback, so it runs after tcp_inspect_request() and
before process_switching_rules(). Its sample-fetch validity checkpoint is
SMP_VAL_FE_SET_BCK, matching the point at which use_backend rules are
evaluated. Like the other frontend events, it is only accepted for SPOE
filters declared in a frontend/listen section.
Patch 1 implements the event, patch 2 documents it, and patch 3 adds a
functional reg-test driven by a minimal stdlib-only SPOA mock, avoiding external
dependencies.
The patches also resolve GH issue https://github.com/haproxy/haproxy/issues/3220
<https://github.com/haproxy/haproxy/issues/3220>.
Hi,
Thanks. Just a comment. If the event is triggered just before the switching
rules, it should probably be named "on-switching-rules".
"on-frontend-tcp-request-done" is ambiguous if used on an HTTP frontend because
we don't know when it is triggered in relation to on-frontend-http-request. In
addition, the new event must be listed in the "event" directive documentation.
I guess the 3 patches can be merged into one.
As a side note, a workaround to your issue would be to use a "send-spoe-group"
action at the right place in your "tcp-request content" ruleset.
Regards,
--
Christopher Faulet