Add web-socket-js support with packet re-ordering.
- web-socket-js is from http://github.com/gimite/web-socket-js. It is a flash object that emultates WebSockets. Unfortunately, events (or packets) from the web-socket-js object can get re-ordered so we need to know the packet order. - So wsproxy.py prepends the sequence number of the packet when sending. - If the client receives packets out of order it queues them up and scans the queue for the sequence number it's looking for until things are back on track. Gross, but hey: It works! - Also, add packet sequence checking to wstest.*
This commit is contained in:
20
vnc.html
20
vnc.html
@@ -2,7 +2,7 @@
|
||||
|
||||
<head><title>VNC Client</title></head>
|
||||
|
||||
<body onload="draw();">
|
||||
<body>
|
||||
|
||||
Host: <input id='host' style='width:100'>
|
||||
Port: <input id='port' style='width:50'>
|
||||
@@ -35,8 +35,26 @@
|
||||
<script src="vnc.js"></script>
|
||||
|
||||
<script>
|
||||
var native_ws = true;
|
||||
|
||||
/* If no builtin websockets then load web_socket.js */
|
||||
if (! window.WebSocket) {
|
||||
var extra = "<script src='include/web-socket-js/swfobject.js'><\/script>";
|
||||
extra += "<script src='include/web-socket-js/FABridge.js'><\/script>";
|
||||
extra += "<script src='include/web-socket-js/web_socket.js'><\/script>";
|
||||
document.write(extra);
|
||||
native_ws = false;
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
console.log("onload");
|
||||
if (native_ws) {
|
||||
console.log("Using native WebSockets");
|
||||
} else {
|
||||
console.log("Using web-socket-js flash bridge");
|
||||
WebSocket.__swfLocation = "web-socket-js/WebSocketMain.swf";
|
||||
RFB.force_copy = true;
|
||||
}
|
||||
var url = document.location.href;
|
||||
$('host').value = (url.match(/host=([^&#]*)/) || ['',''])[1];
|
||||
$('port').value = (url.match(/port=([^&#]*)/) || ['',''])[1];
|
||||
|
||||
Reference in New Issue
Block a user