mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 07:26:24 -05:00
Do not convert @ to \x00
This commit is contained in:
parent
f10f5b4a47
commit
16fe0b03f6
@ -97,10 +97,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
|
|||||||
fb.Type = "serve"
|
fb.Type = "serve"
|
||||||
} else {
|
} else {
|
||||||
switch fb.Dest[0] {
|
switch fb.Dest[0] {
|
||||||
case '@':
|
case '@', '/':
|
||||||
fb.Dest = "\x00" + fb.Dest[1:]
|
|
||||||
fallthrough
|
|
||||||
case '/':
|
|
||||||
fb.Type = "unix"
|
fb.Type = "unix"
|
||||||
default:
|
default:
|
||||||
if _, err := strconv.Atoi(fb.Dest); err == nil {
|
if _, err := strconv.Atoi(fb.Dest); err == nil {
|
||||||
|
@ -113,7 +113,7 @@ func TestVLessInbound(t *testing.T) {
|
|||||||
Alpn: "h2",
|
Alpn: "h2",
|
||||||
Path: "",
|
Path: "",
|
||||||
Type: "unix",
|
Type: "unix",
|
||||||
Dest: "\x00/dev/shm/domain.socket",
|
Dest: "@/dev/shm/domain.socket",
|
||||||
Xver: 2,
|
Xver: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -260,11 +260,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
dest := fb.Dest
|
return newError("failed to dial to " + fb.Dest).Base(err).AtWarning()
|
||||||
if dest[0] == '\x00' {
|
|
||||||
dest = "@" + dest[1:]
|
|
||||||
}
|
|
||||||
return newError("failed to dial to " + dest).Base(err).AtWarning()
|
|
||||||
}
|
}
|
||||||
defer conn.Close() // nolint: errcheck
|
defer conn.Close() // nolint: errcheck
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user