Update trojan.go

This commit is contained in:
xqzr 2025-06-25 04:47:00 +08:00 committed by GitHub
parent 2203dbb34e
commit 8d5677059c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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