fix(config): update protocol handling for Hysteria2 compatibility
This commit is contained in:
parent
6dcd75a39b
commit
a273f8d883
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user