fix(config): update protocol handling for Hysteria2 compatibility

This commit is contained in:
Chang lue Tsen 2025-10-07 09:51:27 -04:00
parent 6dcd75a39b
commit a273f8d883

View File

@ -58,8 +58,9 @@ func (l *GetServerConfigLogic) GetServerConfig(req *types.GetServerConfigRequest
} }
// compatible hysteria2, remove in future versions // compatible hysteria2, remove in future versions
if req.Protocol == Hysteria2 { protocolRequest := req.Protocol
req.Protocol = Hysteria if protocolRequest == Hysteria2 {
protocolRequest = Hysteria
} }
protocols, err := data.UnmarshalProtocols() protocols, err := data.UnmarshalProtocols()
@ -68,7 +69,7 @@ func (l *GetServerConfigLogic) GetServerConfig(req *types.GetServerConfigRequest
} }
var cfg map[string]interface{} var cfg map[string]interface{}
for _, protocol := range protocols { for _, protocol := range protocols {
if protocol.Type == req.Protocol { if protocol.Type == protocolRequest {
cfg = l.compatible(protocol) cfg = l.compatible(protocol)
break break
} }