diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 64d9e9af..03f4cb79 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -97,10 +97,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { fb.Type = "serve" } else { switch fb.Dest[0] { - case '@': - fb.Dest = "\x00" + fb.Dest[1:] - fallthrough - case '/': + case '@', '/': fb.Type = "unix" default: if _, err := strconv.Atoi(fb.Dest); err == nil { diff --git a/infra/conf/vless_test.go b/infra/conf/vless_test.go index ac7124c3..12035095 100644 --- a/infra/conf/vless_test.go +++ b/infra/conf/vless_test.go @@ -113,7 +113,7 @@ func TestVLessInbound(t *testing.T) { Alpn: "h2", Path: "", Type: "unix", - Dest: "\x00/dev/shm/domain.socket", + Dest: "@/dev/shm/domain.socket", Xver: 2, }, { diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index d02a534b..0839d6f6 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -260,11 +260,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i } return nil }); err != nil { - dest := fb.Dest - if dest[0] == '\x00' { - dest = "@" + dest[1:] - } - return newError("failed to dial to " + dest).Base(err).AtWarning() + return newError("failed to dial to " + fb.Dest).Base(err).AtWarning() } defer conn.Close() // nolint: errcheck