only in log-forward sections.
- 'unix@' -> address is a path to a local unix socket
- 'abns@' -> address is in abstract namespace (Linux only).
+ - 'abnsz@' -> address is in abstract namespace (Linux only)
+ but it is explicitly zero-terminated. This means no \0
+ padding is used to complete sun_path. It is useful to
+ interconnect with programs that don't implement the
+ default abns naming logic that haproxy uses.
- 'fd@<n>' -> use file descriptor <n> inherited from the
parent. The fd must be bound and may or may not already
be listening.
listen h3_quic_proxy
bind quic4@10.0.0.1:8888 ssl crt /etc/mycrt
- Note: regarding Linux's abstract namespace sockets, HAProxy uses the whole
- sun_path length is used for the address length. Some other programs
- such as socat use the string length only by default. Pass the option
- ",unix-tightsocklen=0" to any abstract socket definition in socat to
- make it compatible with HAProxy's.
+ Note: regarding Linux's abstract namespace sockets, "abns" HAProxy sockets
+ uses the whole sun_path length is used for the address length. Some
+ other programs such as socat use the string length only by default.
+ Pass the option ",unix-tightsocklen=0" to any abstract socket
+ definition in socat to make it compatible with HAProxy's, or use the
+ "abnsz" HAProxy socket family instead.
See also : "source", "option forwardfor", "unix-bind" and the PROXY protocol
documentation, and section 5 about bind options.
- 'ipv6@' -> address is always IPv6
- 'unix@' -> address is a path to a local unix socket
- 'abns@' -> address is in abstract namespace (Linux only)
+ - 'abnsz@' -> address is in abstract namespace (Linux only)
+ but it is explicitly zero-terminated. This means no \0
+ padding is used to complete sun_path. It is useful to
+ interconnect with programs that don't implement the
+ default abns naming logic that haproxy uses.
- 'sockpair@' -> address is the FD of a connected unix
socket or of a socketpair. During a connection, the
backend creates a pair of connected sockets, and passes
server www1_dc1 "${LAN_DC1}.101:80"
server www1_dc2 "${LAN_DC2}.101:80"
- Note: regarding Linux's abstract namespace sockets, HAProxy uses the whole
- sun_path length is used for the address length. Some other programs
- such as socat use the string length only by default. Pass the option
- ",unix-tightsocklen=0" to any abstract socket definition in socat to
- make it compatible with HAProxy's.
+ Note: regarding Linux's abstract namespace sockets, "abns" HAProxy sockets
+ uses the whole sun_path length is used for the address length. Some
+ other programs such as socat use the string length only by default.
+ Pass the option ",unix-tightsocklen=0" to any abstract socket
+ definition in socat to make it compatible with HAProxy's, or use the
+ "abnsz" HAProxy socket family instead.
See also: "default-server", "http-send-name-header" and section 5 about
server options
- 'ipv6@' -> address is always IPv6
- 'unix@' -> address is a path to a local unix socket
- 'abns@' -> address is in abstract namespace (Linux only)
+ - 'abnsz@' -> address is in zero-terminated abstract namespace
+ (Linux only)
+
You may want to reference some environment variables in the
address parameter, see section 2.3 about environment variables.
'abns@<name>' following <name> is an abstract namespace (Linux only).
+'abnsz@<name>' following <name> is a zero-terminated abstract namespace
+ (Linux only).
+
'fd@<n>' following address is a file descriptor <n> inherited from the
parent. The fd must be bound and may or may not already be
listening.
--- /dev/null
+varnishtest "Abstract unix socket - zero terminated"
+feature ignore_unknown_macro
+feature cmd "command -v curl"
+
+# abns@ sockets are not available on freebsd
+#EXCLUDE_TARGETS=freebsd,osx,generic
+#REGTEST_TYPE=devel
+
+haproxy h1 -W -S -conf {
+ global
+ stats socket "${tmpdir}/h1/stats" level admin expose-fd listeners
+
+ defaults
+ mode http
+ log global
+ option httplog
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
+
+ listen testme
+ bind "fd@${testme}"
+ server f2 abnsz@hap-f2
+
+ frontend f2
+ bind abnsz@hap-f2
+ http-request return status 200 content-type text/plain string "ok"
+} -start
+
+client c1 -connect ${h1_testme_sock} {
+ txreq -url "/"
+ rxresp
+} -run
+
+shell {
+ curl -sfS --abstract-unix-socket hap-f2 "http://host/" | grep "ok"
+}