This commit is contained in:
xqzr 2025-06-25 04:51:18 +08:00 committed by GitHub
commit 4bfdffa9e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View file

@ -544,7 +544,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
} }
default: default:
if _, err = strconv.Atoi(s); err == nil { if _, err = strconv.Atoi(s); err == nil {
s = "127.0.0.1:" + s s = "localhost:" + s
} }
if _, _, err = net.SplitHostPort(s); err == nil { if _, _, err = net.SplitHostPort(s); err == nil {
c.Type = "tcp" c.Type = "tcp"

View file

@ -155,7 +155,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
} }
} else { } else {
if _, err := strconv.Atoi(fb.Dest); err == nil { 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 { if _, _, err := net.SplitHostPort(fb.Dest); err == nil {
fb.Type = "tcp" fb.Type = "tcp"

View file

@ -111,7 +111,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
} }
} else { } else {
if _, err := strconv.Atoi(fb.Dest); err == nil { 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 { if _, _, err := net.SplitHostPort(fb.Dest); err == nil {
fb.Type = "tcp" fb.Type = "tcp"

View file

@ -110,7 +110,7 @@ func TestVLessInbound(t *testing.T) {
Alpn: "", Alpn: "",
Path: "", Path: "",
Type: "tcp", Type: "tcp",
Dest: "127.0.0.1:80", Dest: "localhost:80",
Xver: 0, Xver: 0,
}, },
{ {