fix: hy2 parser

This commit is contained in:
2024-11-16 00:26:54 +08:00
parent e89c70dd85
commit 0681136d65
2 changed files with 12 additions and 3 deletions

View File

@@ -55,6 +55,7 @@ func ParseHysteria(proxy string) (model.Outbound, error) {
protocol, auth, insecure, upmbps, downmbps, obfs, alpnStr := query.Get("protocol"), query.Get("auth"), query.Get("insecure"), query.Get("upmbps"), query.Get("downmbps"), query.Get("obfs"), query.Get("alpn")
insecureBool, err := strconv.ParseBool(insecure)
enableTLS := insecureBool || alpnStr != ""
if err != nil {
insecureBool = false
}
@@ -86,7 +87,7 @@ func ParseHysteria(proxy string) (model.Outbound, error) {
Network: option.NetworkList(protocol),
OutboundTLSOptionsContainer: option.OutboundTLSOptionsContainer{
TLS: &option.OutboundTLSOptions{
Enabled: true,
Enabled: enableTLS,
Insecure: insecureBool,
ALPN: alpn,
},