fix vmess wsheader none

This commit is contained in:
zu1k
2020-08-14 10:46:38 +08:00
parent 3c68aafd18
commit a1b46e9fa4

View File

@@ -70,8 +70,12 @@ func (v Vmess) ToSurge() string {
wsHeasers += "|" + k + ":" + v
}
}
return fmt.Sprintf("%s = vmess, %s, %d, username=%s, ws=true, tls=%t, ws-path=%s, ws-headers=%s",
v.Name, v.Server, v.Port, v.UUID, v.TLS, v.WSPath, wsHeasers)
text := fmt.Sprintf("%s = vmess, %s, %d, username=%s, ws=true, tls=%t, ws-path=%s",
v.Name, v.Server, v.Port, v.UUID, v.TLS, v.WSPath)
if wsHeasers != "" {
text += ", ws-headers=" + wsHeasers
}
return text
} else {
return fmt.Sprintf("%s = vmess, %s, %d, username=%s, tls=%t",
v.Name, v.Server, v.Port, v.UUID, v.TLS)