MINOR: listener: add so_name sample fetch
authorJerome Magnin <jmagnin@haproxy.com>
Fri, 27 Mar 2020 21:08:40 +0000 (22:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Mar 2020 14:52:58 +0000 (16:52 +0200)
commitb86ed397118656f238b6f87be6c9eb701bbdb613
tree8f7b4222ba89eb3cfa7f90966607d79b008145a6
parent26ca3d4aa8d6e18add3ca4c4b472c6e12be6f99b
MINOR: listener: add so_name sample fetch

Add a sample fetch for the name of a bind. This can be useful to
take decisions when PROXY protocol is used and we can't rely on dst,
such as the sample config below.

  defaults
    mode http
  listen bar
    bind 127.0.0.1:1111
    server s1 127.0.1.1:1234 send-proxy

  listen foo
    bind 127.0.1.1:1234 name foo accept-proxy
    http-request return status 200 hdr dst %[dst] if { dst 127.0.1.1 }

(cherry picked from commit eb421b2fe08ff2cfda1a38138591b8cca303f771)
Signed-off-by: Willy Tarreau <w@1wt.eu>
doc/configuration.txt
reg-tests/sample_fetches/so_name.vtc [new file with mode: 0644]
src/listener.c