fix(webconsole): msg write

This commit is contained in:
ioito
2023-07-25 17:09:23 +08:00
parent ce5aefd8e6
commit 01cf8f7eee
3 changed files with 26 additions and 25 deletions
+10 -2
View File
@@ -52,15 +52,23 @@ func init() {
return err
}
connectParams := resp.GetConnectParams()
if protocol, err := resp.GetConnectProtocol(); err != nil {
protocol, err := resp.GetConnectProtocol()
if err != nil {
return err
} else if !utils.IsInStringArray(protocol, []string{
}
if !utils.IsInStringArray(protocol, []string{
command.PROTOCOL_TTY, webconsole_api.VNC,
webconsole_api.SPICE, webconsole_api.WMKS, webconsole_api.WS,
}) {
fmt.Println(connectParams)
return nil
}
if protocol == webconsole_api.WS {
u, err = url.Parse(fmt.Sprintf("%s/ws", opt.WebconsoleUrl))
if err != nil {
return err
}
}
newQuery := url.Values{}
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connectParams)))