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
082027dc
Commit
082027dc
authored
Apr 14, 2014
by
samhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync with websockify
Pull 90b519edf0c1857d
parent
60a415ae
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
768 additions
and
551 deletions
+768
-551
websock.js
include/websock.js
+6
-10
websocket.py
utils/websocket.py
+529
-386
websockify
utils/websockify
+233
-155
No files found.
include/websock.js
View file @
082027dc
...
...
@@ -262,7 +262,7 @@ function on(evt, handler) {
eventHandlers
[
evt
]
=
handler
;
}
function
init
(
protocols
,
ws_schema
)
{
function
init
(
protocols
)
{
rQ
=
[];
rQi
=
0
;
sQ
=
[];
...
...
@@ -278,14 +278,11 @@ function init(protocols, ws_schema) {
bt
=
true
;
}
// Check for full binary type support in WebSocket
// Inspired by:
// https://github.com/Modernizr/Modernizr/issues/370
// https://github.com/Modernizr/Modernizr/blob/master/feature-detects/websockets/binary.js
// Check for full binary type support in WebSockets
// TODO: this sucks, the property should exist on the prototype
// but it does not.
try
{
if
(
bt
&&
(
'binaryType'
in
WebSocket
.
prototype
||
!!
(
new
WebSocket
(
ws_schema
+
'://.'
).
binaryType
)))
{
if
(
bt
&&
(
'binaryType'
in
(
new
WebSocket
(
"ws://localhost:17523"
))))
{
Util
.
Info
(
"Detected binaryType support in WebSockets"
);
wsbt
=
true
;
}
...
...
@@ -328,8 +325,7 @@ function init(protocols, ws_schema) {
}
function
open
(
uri
,
protocols
)
{
var
ws_schema
=
uri
.
match
(
/^
([
a-z
]
+
)
:
\/\/
/
)[
1
];
protocols
=
init
(
protocols
,
ws_schema
);
protocols
=
init
(
protocols
);
if
(
test_mode
)
{
websocket
=
{};
...
...
utils/websocket.py
View file @
082027dc
This diff is collapsed.
Click to expand it.
utils/websockify
View file @
082027dc
This diff is collapsed.
Click to expand it.
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