- 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.*
66 lines
2.4 KiB
HTML
66 lines
2.4 KiB
HTML
<html>
|
|
|
|
<head><title>VNC Client</title></head>
|
|
|
|
<body>
|
|
|
|
Host: <input id='host' style='width:100'>
|
|
Port: <input id='port' style='width:50'>
|
|
Password: <input id='password' type='password' style='width:80'>
|
|
<input id='connectButton' type='button' value='Connect' style='width:100px'
|
|
onclick="RFB.connect();">
|
|
<br><br>
|
|
|
|
<div id='status'>Disconnected</div>
|
|
<canvas id="vnc" width="640" height="20"
|
|
style="border-style: dotted; border-width: 1px;">
|
|
Canvas not supported.
|
|
</canvas>
|
|
|
|
<br><br>
|
|
VNC Clipboard:
|
|
<input id='clearButton' type="button" value="Clear"
|
|
onclick="RFB.clipboardClear();"><br>
|
|
<textarea id="clipboard" style="font-size:9;" cols=80 rows=5
|
|
onchange="RFB.clipboardPasteFrom();"
|
|
onfocus="RFB.clipboardFocus=true;"
|
|
onblur="RFB.clipboardFocus=false;"></textarea>
|
|
</body>
|
|
|
|
<script src="include/mootools.js"></script>
|
|
<script src="include/base64.js"></script>
|
|
<script src="include/des.js"></script>
|
|
<script src="include/util.js"></script>
|
|
<script src="canvas.js"></script>
|
|
<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];
|
|
$('password').value = (url.match(/password=([^&#]*)/) || ['',''])[1];
|
|
}
|
|
</script>
|
|
|
|
</html>
|