完成资产附加属性功能

This commit is contained in:
dushixiang
2021-02-12 15:42:02 +08:00
parent 25c3c6b929
commit 7599c09191
10 changed files with 72 additions and 270 deletions

View File

@ -10,6 +10,7 @@ import (
type Tun struct {
Protocol string
Mode string
WebSocket *websocket.Conn
Tunnel *guacd.Tunnel
NextTerminal *term.NextTerminal
@ -25,7 +26,7 @@ func (r *Tun) Close(code int, reason string) {
ws := r.WebSocket
if ws != nil {
if r.Protocol == "rdp" || r.Protocol == "vnc" {
if r.Mode == "guacd" {
err := guacd.NewInstruction("error", reason, strconv.Itoa(code))
_ = ws.WriteMessage(websocket.TextMessage, []byte(err.String()))
disconnect := guacd.NewInstruction("disconnect")