feat(inbounds): support Unix domain socket path in Listen field (#4429)

UDS listen already worked for proxying (the listen string is passed to xray verbatim and port 0 is accepted), and the Go sub/link layer already ignores the bind listen. The only gap was the frontend resolveAddr, which would put a socket-path listen into share/sub links (e.g. vless://uuid@/run/xray/x.sock:0). resolveAddr now treats a path-style listen (starting with / or @) as having no client-reachable address and falls back to hostOverride/hostname. Adds a test and a Listen-field help hint across all locales.
This commit is contained in:
MHSanaei
2026-06-02 00:37:20 +02:00
parent cb17eb8c06
commit b2e2120eb3
18 changed files with 55 additions and 21 deletions
+13
View File
@@ -196,6 +196,19 @@ describe('resolveAddr precedence', () => {
)).toBe('fallback.test');
});
it('skips a unix socket path listen and falls through to fallbackHostname', () => {
expect(resolveAddr(
{ ...baseInbound, listen: '/run/xray/in.sock' } as never,
'',
'fallback.test',
)).toBe('fallback.test');
expect(resolveAddr(
{ ...baseInbound, listen: '@xray-abstract' } as never,
'',
'fallback.test',
)).toBe('fallback.test');
});
it('falls through to fallbackHostname when listen is empty', () => {
expect(resolveAddr(
baseInbound as never,