diff --git a/code/client/main.go b/code/client/main.go index c99c3e3..f1bd7b6 100644 --- a/code/client/main.go +++ b/code/client/main.go @@ -134,6 +134,7 @@ func main() { version := flag.Bool("version", false, "show version info") act := flag.String("action", "", "install or uninstall") vport := flag.Uint("vport", 6155, "vnc worker listen port") + vcursor := flag.Bool("vcursor", false, "vnc show cursor") flag.Parse() if *version { @@ -174,7 +175,7 @@ func main() { defer utils.Recover("vnc.worker") logging.SetSizeRotate(cfg.LogDir, "np-cli.vnc", int(cfg.LogSize.Bytes()), cfg.LogRotate, true) defer logging.Flush() - vnc.RunWorker(uint16(*vport)) + vnc.RunWorker(uint16(*vport), *vcursor) return } diff --git a/code/client/pool/send_conn.go b/code/client/pool/send_conn.go index 3aa4f5b..e87b59f 100644 --- a/code/client/pool/send_conn.go +++ b/code/client/pool/send_conn.go @@ -68,7 +68,7 @@ func (conn *Conn) SendConnectReq(id string, cfg global.Tunnel) { } // SendConnectVnc send connect vnc request message -func (conn *Conn) SendConnectVnc(id string, cfg global.Tunnel, quality uint64) { +func (conn *Conn) SendConnectVnc(id string, cfg global.Tunnel, quality uint64, showCursor bool) { var msg network.Msg msg.To = cfg.Target msg.XType = network.Msg_connect_req @@ -87,6 +87,7 @@ func (conn *Conn) SendConnectVnc(id string, cfg global.Tunnel, quality uint64) { Cvnc: &network.ConnectVnc{ Fps: cfg.Fps, Quality: uint32(quality), + Cursor: showCursor, }, }, }, diff --git a/code/client/tunnel/vnc/define/user32_windows.go b/code/client/tunnel/vnc/define/user32_windows.go index 39e3822..dc71df1 100644 --- a/code/client/tunnel/vnc/define/user32_windows.go +++ b/code/client/tunnel/vnc/define/user32_windows.go @@ -11,4 +11,39 @@ var ( FuncGetDesktopWindow, _ = syscall.GetProcAddress(syscall.Handle(libUser32), "GetDesktopWindow") FuncGetDC, _ = syscall.GetProcAddress(syscall.Handle(libUser32), "GetDC") FuncReleaseDC, _ = syscall.GetProcAddress(syscall.Handle(libUser32), "ReleaseDC") + FuncGetCursorInfo, _ = syscall.GetProcAddress(syscall.Handle(libUser32), "GetCursorInfo") + FuncDrawIcon, _ = syscall.GetProcAddress(syscall.Handle(libUser32), "DrawIcon") +) + +type ( + HANDLE uintptr + BOOL int32 + DWORD uint32 + LONG int32 + HCURSOR HANDLE + HBITMAP HANDLE +) + +type POINT struct { + X LONG + Y LONG +} + +type CURSORINFO struct { + CbSize DWORD + Flags DWORD + HCursor HCURSOR + PTScreenPos POINT +} + +type ICONINFO struct { + FIcon BOOL + XHotspot DWORD + YHotspot DWORD + HbmMask HBITMAP + HbmColor HBITMAP +} + +const ( + CURSOR_SHOWING = 0x00000001 ) diff --git a/code/client/tunnel/vnc/h_new.go b/code/client/tunnel/vnc/h_new.go index 3750fa6..727f911 100644 --- a/code/client/tunnel/vnc/h_new.go +++ b/code/client/tunnel/vnc/h_new.go @@ -18,9 +18,14 @@ func (v *VNC) New(pool *pool.Pool, w http.ResponseWriter, r *http.Request) { v.link.close() } q := r.FormValue("quality") + s := r.FormValue("show_cursor") quality, err := strconv.ParseUint(q, 10, 32) if err != nil { - quality = 75 + quality = 50 + } + showCursor, err := strconv.ParseBool(s) + if err != nil { + showCursor = false } id, err := runtime.UUID(16, "0123456789abcdef") if err != nil { @@ -36,7 +41,7 @@ func (v *VNC) New(pool *pool.Pool, w http.ResponseWriter, r *http.Request) { old.SendDisconnect(v.link.target, v.link.targetIdx, v.link.id) } } - conn.SendConnectVnc(id, v.cfg, quality) + conn.SendConnectVnc(id, v.cfg, quality, showCursor) v.link = v.NewLink(id, v.cfg.Target, 0, nil, conn).(*Link) ch := conn.ChanRead(id) timeout := time.After(conn.ReadTimeout) diff --git a/code/client/tunnel/vnc/worker.go b/code/client/tunnel/vnc/worker.go index cb871ed..020d42d 100644 --- a/code/client/tunnel/vnc/worker.go +++ b/code/client/tunnel/vnc/worker.go @@ -9,8 +9,8 @@ import ( ) // RunWorker run vnc worker -func RunWorker(port uint16) { - worker := worker.NewWorker() +func RunWorker(port uint16, cursor bool) { + worker := worker.NewWorker(cursor) if worker == nil { panic("build context failed") } diff --git a/code/client/tunnel/vnc/worker/capture_windows.go b/code/client/tunnel/vnc/worker/capture_windows.go index 3865e7f..b62b30c 100644 --- a/code/client/tunnel/vnc/worker/capture_windows.go +++ b/code/client/tunnel/vnc/worker/capture_windows.go @@ -77,7 +77,31 @@ func (worker *Worker) capture() error { return errors.New("bitblt: " + err.Error()) } defer worker.copyImageData(bitmap) - // TODO: draw cursor + if !worker.showCursor { + return + } + var curInfo CURSORINFO + curInfo.CbSize = DWORD(unsafe.Sizeof(curInfo)) + ok, _, err = syscall.Syscall(define.FuncGetCursorInfo, 1, uintptr(unsafe.Pointer(&curInfo)), 0, 0) + if ok == 0 { + logging.Error("get cursor info: %v", err) + return nil + } + if curInfo.Flags == CURSOR_SHOWING { + var info ICONINFO + ok, _, err = syscall.Syscall(define.FuncGetIconInfo, 2, uintptr(curInfo.HCursor), uintptr(unsafe.Pointer(&info)), 0) + if ok == 0 { + logging.Error("get icon info: %v", err) + return nil + } + x := curInfo.PTScreenPos.X - LONG(info.XHotspot) + y := curInfo.PTScreenPos.Y - LONG(info.YHotspot) + ok, _, err = syscall.Syscall6(define.FuncDrawIcon, 4, memDC, uintptr(x), uintptr(y), uintptr(curInfo.HCursor), 0, 0) + if ok == 0 { + logging.Error("draw icon: %v", err) + return nil + } + } return nil } diff --git a/code/client/tunnel/vnc/worker/worker.go b/code/client/tunnel/vnc/worker/worker.go index 74527cc..fe97741 100644 --- a/code/client/tunnel/vnc/worker/worker.go +++ b/code/client/tunnel/vnc/worker/worker.go @@ -20,11 +20,14 @@ type desktopInfo struct { type Worker struct { workerOsBased - info desktopInfo + info desktopInfo + showCursor bool } -func NewWorker() *Worker { - worker := &Worker{} +func NewWorker(showCursor bool) *Worker { + worker := &Worker{ + showCursor: showCursor, + } err := worker.init() if err != nil { return nil diff --git a/code/network/connect.pb.go b/code/network/connect.pb.go index 1cb1849..ad141cb 100644 --- a/code/network/connect.pb.go +++ b/code/network/connect.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.16.0 +// protoc v3.6.1 // source: connect.proto package network @@ -189,6 +189,7 @@ type ConnectVnc struct { Fps uint32 `protobuf:"varint,1,opt,name=fps,proto3" json:"fps,omitempty"` Quality uint32 `protobuf:"varint,2,opt,name=quality,proto3" json:"quality,omitempty"` // image quality, percent + Cursor bool `protobuf:"varint,3,opt,name=cursor,proto3" json:"cursor,omitempty"` // show cursor } func (x *ConnectVnc) Reset() { @@ -237,6 +238,13 @@ func (x *ConnectVnc) GetQuality() uint32 { return 0 } +func (x *ConnectVnc) GetCursor() bool { + if x != nil { + return x.Cursor + } + return false +} + type ConnectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -413,33 +421,35 @@ var file_connect_proto_rawDesc = []byte{ 0x22, 0x35, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x78, 0x65, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x39, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x51, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x6e, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x70, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x22, 0x9f, 0x02, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, - 0x0a, 0x05, 0x63, 0x61, 0x64, 0x64, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x48, 0x00, 0x52, 0x05, 0x63, 0x61, 0x64, 0x64, 0x72, 0x12, 0x30, 0x0a, - 0x06, 0x63, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, - 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x12, - 0x2a, 0x0a, 0x04, 0x63, 0x76, 0x6e, 0x63, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, - 0x76, 0x6e, 0x63, 0x48, 0x00, 0x52, 0x04, 0x63, 0x76, 0x6e, 0x63, 0x22, 0x2c, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x74, 0x63, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, - 0x75, 0x64, 0x70, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x10, 0x02, - 0x12, 0x07, 0x0a, 0x03, 0x76, 0x6e, 0x63, 0x10, 0x03, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x34, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, - 0x3b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x9f, 0x02, 0x0a, 0x0f, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x63, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x48, 0x00, 0x52, 0x05, + 0x63, 0x61, 0x64, 0x64, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x48, 0x00, 0x52, + 0x06, 0x63, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x63, 0x76, 0x6e, 0x63, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x6e, 0x63, 0x48, 0x00, 0x52, 0x04, 0x63, + 0x76, 0x6e, 0x63, 0x22, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x74, + 0x63, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x75, 0x64, 0x70, 0x10, 0x01, 0x12, 0x09, 0x0a, + 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x76, 0x6e, 0x63, 0x10, + 0x03, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x34, 0x0a, 0x10, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, + 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, + 0x73, 0x67, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x3b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/code/network/connect.proto b/code/network/connect.proto index 66d4125..0bc3c21 100644 --- a/code/network/connect.proto +++ b/code/network/connect.proto @@ -16,6 +16,7 @@ message connect_shell { message connect_vnc { uint32 fps = 1; uint32 quality = 2; // image quality, percent + bool cursor = 3; // show cursor } message connect_request { diff --git a/code/network/forward.pb.go b/code/network/forward.pb.go index 339ded4..5303fb2 100644 --- a/code/network/forward.pb.go +++ b/code/network/forward.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.16.0 +// protoc v3.6.1 // source: forward.proto package network diff --git a/code/network/msg.pb.go b/code/network/msg.pb.go index c5f82cb..ab6a7d7 100644 --- a/code/network/msg.pb.go +++ b/code/network/msg.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.16.0 +// protoc v3.6.1 // source: msg.proto package network diff --git a/code/network/shell.pb.go b/code/network/shell.pb.go index a3b4457..ea25237 100644 --- a/code/network/shell.pb.go +++ b/code/network/shell.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.16.0 +// protoc v3.6.1 // source: shell.proto package network diff --git a/code/network/vnc.pb.go b/code/network/vnc.pb.go index b527cf7..74e40f0 100644 --- a/code/network/vnc.pb.go +++ b/code/network/vnc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.16.0 +// protoc v3.6.1 // source: vnc.proto package network @@ -176,6 +176,7 @@ type VncControl struct { unknownFields protoimpl.UnknownFields Quality uint32 `protobuf:"varint,1,opt,name=quality,proto3" json:"quality,omitempty"` // image quality, percent + Cursor bool `protobuf:"varint,2,opt,name=cursor,proto3" json:"cursor,omitempty"` // show cursor } func (x *VncControl) Reset() { @@ -217,6 +218,13 @@ func (x *VncControl) GetQuality() uint32 { return 0 } +func (x *VncControl) GetCursor() bool { + if x != nil { + return x.Cursor + } + return false +} + type VncImage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -498,53 +506,54 @@ var File_vnc_proto protoreflect.FileDescriptor var file_vnc_proto_rawDesc = []byte{ 0x0a, 0x09, 0x76, 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x22, 0x27, 0x0a, 0x0b, 0x76, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x22, 0x3f, 0x0a, 0x0b, 0x76, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0xe9, 0x02, - 0x0a, 0x09, 0x76, 0x6e, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x69, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x06, 0x65, 0x6e, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x1a, 0xbc, 0x01, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x73, - 0x63, 0x72, 0x65, 0x65, 0x6e, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0b, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x23, - 0x0a, 0x0d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x65, 0x63, 0x74, 0x58, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, - 0x63, 0x74, 0x5f, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x65, 0x63, 0x74, - 0x59, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x63, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, - 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x22, 0x26, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x0a, - 0x03, 0x72, 0x61, 0x77, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x6a, 0x70, 0x65, 0x67, 0x10, 0x01, - 0x12, 0x07, 0x0a, 0x03, 0x70, 0x6e, 0x67, 0x10, 0x02, 0x22, 0xb7, 0x01, 0x0a, 0x09, 0x76, 0x6e, - 0x63, 0x5f, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, - 0x76, 0x6e, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x2b, 0x0a, 0x03, 0x62, 0x74, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x52, 0x03, 0x62, 0x74, 0x6e, 0x12, 0x0c, 0x0a, - 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x79, 0x22, 0x38, 0x0a, 0x06, 0x62, 0x75, 0x74, - 0x74, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x75, 0x6e, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x74, 0x6e, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, - 0x74, 0x10, 0x03, 0x22, 0x49, 0x0a, 0x0c, 0x76, 0x6e, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x62, 0x6f, - 0x61, 0x72, 0x64, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x2a, 0x2c, - 0x0a, 0x0a, 0x76, 0x6e, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, - 0x75, 0x6e, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x64, 0x6f, - 0x77, 0x6e, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x75, 0x70, 0x10, 0x02, 0x42, 0x0c, 0x5a, 0x0a, - 0x2e, 0x2f, 0x3b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, + 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0xe9, 0x02, 0x0a, 0x09, 0x76, 0x6e, 0x63, 0x5f, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, + 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x33, 0x0a, 0x06, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x06, + 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xbc, 0x01, 0x0a, 0x04, 0x69, + 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x5f, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x63, 0x72, 0x65, 0x65, + 0x6e, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, + 0x63, 0x72, 0x65, 0x65, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, + 0x65, 0x63, 0x74, 0x5f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x65, 0x63, + 0x74, 0x58, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x72, 0x65, 0x63, 0x74, 0x59, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x63, + 0x74, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, + 0x65, 0x63, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x74, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, + 0x65, 0x63, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x26, 0x0a, 0x08, 0x65, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x6a, 0x70, 0x65, 0x67, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x6e, 0x67, 0x10, + 0x02, 0x22, 0xb7, 0x01, 0x0a, 0x09, 0x76, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x12, + 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x03, 0x62, 0x74, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, + 0x76, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, + 0x52, 0x03, 0x62, 0x74, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, + 0x79, 0x22, 0x38, 0x0a, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x75, + 0x6e, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x74, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x6c, 0x65, + 0x66, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x10, 0x02, + 0x12, 0x09, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x10, 0x03, 0x22, 0x49, 0x0a, 0x0c, 0x76, + 0x6e, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x27, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2e, 0x76, 0x6e, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x2a, 0x2c, 0x0a, 0x0a, 0x76, 0x6e, 0x63, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x75, 0x6e, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x74, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, + 0x75, 0x70, 0x10, 0x02, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x3b, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/code/network/vnc.proto b/code/network/vnc.proto index eac479a..aa3a851 100644 --- a/code/network/vnc.proto +++ b/code/network/vnc.proto @@ -5,6 +5,7 @@ option go_package="./;network"; message vnc_control { uint32 quality = 1; // image quality, percent + bool cursor = 2; // show cursor } message vnc_image { diff --git a/go.mod b/go.mod index 9e60e99..25394c0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/lwch/logging v0.0.0-20210831025517-ae81047d6190 github.com/lwch/runtime v0.0.0-20190520054850-8c97e19e0c6d github.com/lwch/yaml v0.0.0-20211009070949-2d4c64e2b789 - golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 + golang.org/x/sys v0.0.0-20211101204403-39c9dd37992c golang.org/x/text v0.3.7 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index 79b2dc7..3d35eb1 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0NHHxO3Z0g7Gus2O1kk= -golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211101204403-39c9dd37992c h1:rnNohYBMnXA07uGnZ9CSWNhIu4Gob4FqWS43lLqZ2sU= +golang.org/x/sys v0.0.0-20211101204403-39c9dd37992c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/html/vnc/AdminLTE b/html/vnc/AdminLTE new file mode 120000 index 0000000..95ea729 --- /dev/null +++ b/html/vnc/AdminLTE @@ -0,0 +1 @@ +../AdminLTE-3.1.0 \ No newline at end of file diff --git a/html/vnc/bootstrap b/html/vnc/bootstrap new file mode 120000 index 0000000..4216f99 --- /dev/null +++ b/html/vnc/bootstrap @@ -0,0 +1 @@ +../bootstrap-5.1.3 \ No newline at end of file diff --git a/html/vnc/index.html b/html/vnc/index.html index d2f3ea7..dc3dc98 100644 --- a/html/vnc/index.html +++ b/html/vnc/index.html @@ -5,11 +5,30 @@