1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 18:00:43 +00:00

Do not convert @ to \x00

This commit is contained in:
RPRX 2020-09-07 16:39:53 +08:00 committed by GitHub
parent f10f5b4a47
commit 16fe0b03f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 10 deletions

View File

@ -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 {

View File

@ -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,
},
{

View File

@ -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