Supporting UNIX sockets in address matching.

This closes #645 issue on GitHub.

(Also moved a changelog line that was misplaced in a previous commit.)
This commit is contained in:
Alejandro Colomar
2022-02-28 12:12:30 +01:00
parent c1cea3c97d
commit 6e36584a2e
5 changed files with 35 additions and 7 deletions

View File

@@ -41,6 +41,16 @@ nxt_http_route_addr_pattern_parse(nxt_mp_t *mp,
base->negative = 0;
}
if (nxt_str_eq(&addr, "unix", 4)) {
#if (NXT_HAVE_UNIX_DOMAIN)
base->addr_family = AF_UNIX;
return NXT_OK;
#else
return NXT_ADDR_PATTERN_NO_UNIX_ERROR;
#endif
}
if (nxt_slow_path(addr.length < 2)) {
return NXT_ADDR_PATTERN_LENGTH_ERROR;
}