The domain_socket datatype (added for Unix domain socket listener support in RabbitMQ) requires config values in the form:
i.e. a unix: or local: prefix and a trailing :0. A bare path (/var/run/app.sock) is rejected.
Two things drive this, both in cuttlefish_datatypes.erl:
validate_uds/1 keys on the unix:/local: prefix to disambiguate a socket path from an IP address, because a datatype union like [integer, ip, domain_socket] tries each converter in order and a bare path cannot be positively identified as a socket.
from_string/2 reuses the shared address:port splitting (string:rchr(String, $:)), so a :port component must be present even though a Unix domain socket has no port — only :0 is accepted.
The prefix requirement is a reasonable disambiguation strategy, but the mandatory :0 is a surprising artifact of reusing the IP/port parser. It would be nicer to accept a bare prefixed path (unix:/var/run/app.sock) and default the port to 0.
I'm a maintainer here and intend to address this.
The
domain_socketdatatype (added for Unix domain socket listener support in RabbitMQ) requires config values in the form:i.e. a
unix:orlocal:prefix and a trailing:0. A bare path (/var/run/app.sock) is rejected.Two things drive this, both in
cuttlefish_datatypes.erl:validate_uds/1keys on theunix:/local:prefix to disambiguate a socket path from an IP address, because a datatype union like[integer, ip, domain_socket]tries each converter in order and a bare path cannot be positively identified as a socket.from_string/2reuses the sharedaddress:portsplitting (string:rchr(String, $:)), so a:portcomponent must be present even though a Unix domain socket has no port — only:0is accepted.The prefix requirement is a reasonable disambiguation strategy, but the mandatory
:0is a surprising artifact of reusing the IP/port parser. It would be nicer to accept a bare prefixed path (unix:/var/run/app.sock) and default the port to0.I'm a maintainer here and intend to address this.