From 579d83b05f98e061c535537169ce39b7271c3efe Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 22 Nov 2019 15:34:17 +0100 Subject: [PATCH] DOC: Add documentation about the use-service action The use-service action may be used in tcp-request and http-request rules. It was added to customize HAproxy reply to a client using an applet (initially a lua applet). But the documentation was missing. This patch may be backported as far as 1.6. --- doc/configuration.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/configuration.txt b/doc/configuration.txt index 2407fcb01..55a8fa728 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -4815,6 +4815,21 @@ http-request unset-var() [ { if | unless } ] Example: http-request unset-var(req.my_var) +http-request use-service [ { if | unless } ] + + This directive executes the configured HTTP service to reply to the request + and stops the evaluation of the rules. An HTTP service may choose to reply by + sending any valid HTTP response or it may immediately close the connection + without sending any response. Outside natives services, for instance the + Prometheus exporter, it is possible to write your own services in Lua. No + further "http-request" rules are evaluated. + + Arguments : + is mandatory. It is the service to call + + Example: + http-request use-service prometheus-exporter if { path /metrics } + http-request wait-for-handshake [ { if | unless } ] This will delay the processing of the request until the SSL handshake @@ -9570,6 +9585,7 @@ tcp-request content [{if | unless} ] - unset-var() - silent-drop - send-spoe-group + - use-service They have the same meaning as their counter-parts in "tcp-request connection" so please refer to that section for a complete description. @@ -9656,6 +9672,16 @@ tcp-request content [{if | unless} ] The SPOE group name as specified in the engine configuration. + The "use-service" is used to executes a TCP service which will reply to the + request and stop the evaluation of the rules. This service may choose to + reply by sending any valid response or it may immediately close the + connection without sending anything. Outside natives services, it is possible + to write your own services in Lua. No further "tcp-request" rules are + evaluated. + + Example: + tcp-request content use-service lua.deny { src -f /etc/haproxy/blacklist.lst } + Example: tcp-request content set-var(sess.my_var) src