diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index d762be32..f6c46efb 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -544,7 +544,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) { } default: if _, err = strconv.Atoi(s); err == nil { - s = "127.0.0.1:" + s + s = "localhost:" + s } if _, _, err = net.SplitHostPort(s); err == nil { c.Type = "tcp" diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index 62c8f55b..4a230514 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -155,7 +155,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) { } } else { if _, err := strconv.Atoi(fb.Dest); err == nil { - fb.Dest = "127.0.0.1:" + fb.Dest + fb.Dest = "localhost:" + fb.Dest } if _, _, err := net.SplitHostPort(fb.Dest); err == nil { fb.Type = "tcp" diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 27da68dc..5d4ace6f 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -111,7 +111,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { } } else { if _, err := strconv.Atoi(fb.Dest); err == nil { - fb.Dest = "127.0.0.1:" + fb.Dest + fb.Dest = "localhost:" + fb.Dest } if _, _, err := net.SplitHostPort(fb.Dest); err == nil { fb.Type = "tcp" diff --git a/infra/conf/vless_test.go b/infra/conf/vless_test.go index 0f702437..8f1baaa5 100644 --- a/infra/conf/vless_test.go +++ b/infra/conf/vless_test.go @@ -110,7 +110,7 @@ func TestVLessInbound(t *testing.T) { Alpn: "", Path: "", Type: "tcp", - Dest: "127.0.0.1:80", + Dest: "localhost:80", Xver: 0, }, {