Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
a856a051
Commit
a856a051
authored
Sep 28, 2013
by
Malcolm Scott
Committed by
Solly Ross
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement XVP extension (shutdown/reboot/reset)
parent
03ab2515
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
rfb.js
include/rfb.js
+45
-2
No files found.
include/rfb.js
View file @
a856a051
...
@@ -47,6 +47,8 @@ var that = {}, // Public API methods
...
@@ -47,6 +47,8 @@ var that = {}, // Public API methods
rfb_auth_scheme
=
''
,
rfb_auth_scheme
=
''
,
rfb_tightvnc
=
false
,
rfb_tightvnc
=
false
,
rfb_xvp_ver
=
0
,
// In preference order
// In preference order
encodings
=
[
encodings
=
[
...
@@ -65,7 +67,8 @@ var that = {}, // Public API methods
...
@@ -65,7 +67,8 @@ var that = {}, // Public API methods
//['JPEG_quality_hi', -23 ],
//['JPEG_quality_hi', -23 ],
//['compress_lo', -255 ],
//['compress_lo', -255 ],
[
'compress_hi'
,
-
247
],
[
'compress_hi'
,
-
247
],
[
'last_rect'
,
-
224
]
[
'last_rect'
,
-
224
],
[
'xvp'
,
-
309
]
],
],
encHandlers
=
{},
encHandlers
=
{},
...
@@ -161,6 +164,8 @@ Util.conf_defaults(conf, that, defaults, [
...
@@ -161,6 +164,8 @@ Util.conf_defaults(conf, that, defaults, [
'onFBResize(rfb, width, height): frame buffer resized'
],
'onFBResize(rfb, width, height): frame buffer resized'
],
[
'onDesktopName'
,
'rw'
,
'func'
,
function
()
{
},
[
'onDesktopName'
,
'rw'
,
'func'
,
function
()
{
},
'onDesktopName(rfb, name): desktop name received'
],
'onDesktopName(rfb, name): desktop name received'
],
[
'onXvpInit'
,
'rw'
,
'func'
,
function
()
{
},
'onXvpInit(version): XVP extensions active for this connection'
],
// These callback names are deprecated
// These callback names are deprecated
[
'updateState'
,
'rw'
,
'func'
,
function
()
{
},
[
'updateState'
,
'rw'
,
'func'
,
function
()
{
},
...
@@ -991,7 +996,8 @@ normal_msg = function() {
...
@@ -991,7 +996,8 @@ normal_msg = function() {
//Util.Debug(">> normal_msg");
//Util.Debug(">> normal_msg");
var
ret
=
true
,
msg_type
,
length
,
text
,
var
ret
=
true
,
msg_type
,
length
,
text
,
c
,
first_colour
,
num_colours
,
red
,
green
,
blue
;
c
,
first_colour
,
num_colours
,
red
,
green
,
blue
,
xvp_ver
,
xvp_msg
;
if
(
FBU
.
rects
>
0
)
{
if
(
FBU
.
rects
>
0
)
{
msg_type
=
0
;
msg_type
=
0
;
...
@@ -1041,6 +1047,24 @@ normal_msg = function() {
...
@@ -1041,6 +1047,24 @@ normal_msg = function() {
conf
.
clipboardReceive
(
that
,
text
);
// Obsolete
conf
.
clipboardReceive
(
that
,
text
);
// Obsolete
conf
.
onClipboard
(
that
,
text
);
conf
.
onClipboard
(
that
,
text
);
break
;
break
;
case
250
:
// XVP
ws
.
rQshift8
();
// Padding
xvp_ver
=
ws
.
rQshift8
();
xvp_msg
=
ws
.
rQshift8
();
switch
(
xvp_msg
)
{
case
0
:
// XVP_FAIL
updateState
(
rfb_state
,
"Operation failed"
);
break
;
case
1
:
// XVP_INIT
rfb_xvp_ver
=
xvp_ver
;
Util
.
Info
(
"XVP extensions enabled (version "
+
rfb_xvp_ver
+
")"
);
conf
.
onXvpInit
(
rfb_xvp_ver
);
break
;
default
:
fail
(
"Disconnected: illegal server XVP message "
+
xvp_msg
);
break
;
}
break
;
default
:
default
:
fail
(
"Disconnected: illegal server message type "
+
msg_type
);
fail
(
"Disconnected: illegal server message type "
+
msg_type
);
Util
.
Debug
(
"ws.rQslice(0,30):"
+
ws
.
rQslice
(
0
,
30
));
Util
.
Debug
(
"ws.rQslice(0,30):"
+
ws
.
rQslice
(
0
,
30
));
...
@@ -1895,6 +1919,25 @@ that.sendCtrlAltDel = function() {
...
@@ -1895,6 +1919,25 @@ that.sendCtrlAltDel = function() {
ws
.
send
(
arr
);
ws
.
send
(
arr
);
};
};
that
.
xvpOp
=
function
(
ver
,
op
)
{
if
(
rfb_xvp_ver
<
ver
)
{
return
false
;
}
Util
.
Info
(
"Sending XVP operation "
+
op
+
" (version "
+
ver
+
")"
)
ws
.
send_string
(
"
\
xFA
\
x00"
+
String
.
fromCharCode
(
ver
)
+
String
.
fromCharCode
(
op
));
return
true
;
};
that
.
xvpShutdown
=
function
()
{
return
that
.
xvpOp
(
1
,
2
);
};
that
.
xvpReboot
=
function
()
{
return
that
.
xvpOp
(
1
,
3
);
};
that
.
xvpReset
=
function
()
{
return
that
.
xvpOp
(
1
,
4
);
};
// Send a key press. If 'down' is not specified then send a down key
// Send a key press. If 'down' is not specified then send a down key
// followed by an up key.
// followed by an up key.
that
.
sendKey
=
function
(
code
,
down
)
{
that
.
sendKey
=
function
(
code
,
down
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment