Support WebSockets 76 (hixie-76, hybi-00).
Looks like disabling web-socket-js debug messages by default that we get a minor speedup. Python proxy should support both 75 and 76 (00) modes. Also, update ws test to more reliably hit the WebSockets ordering/drop issue.
This commit is contained in:
+22
-13
@@ -1,6 +1,18 @@
|
||||
<html>
|
||||
|
||||
<head><title>WebSockets Test</title></head>
|
||||
<head>
|
||||
<title>WebSockets Test</title>
|
||||
<script src="include/mootools.js"></script>
|
||||
<script src="include/base64.js"></script>
|
||||
<script src="include/util.js"></script>
|
||||
<!-- Uncomment to activate firebug lite -->
|
||||
<!--
|
||||
<script type='text/javascript'
|
||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||
-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -31,16 +43,6 @@
|
||||
</body>
|
||||
|
||||
|
||||
<!-- Uncomment to activate firebug lite -->
|
||||
<!--
|
||||
<script type='text/javascript'
|
||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||
-->
|
||||
|
||||
<script src="include/mootools.js"></script>
|
||||
<script src="include/base64.js"></script>
|
||||
<script src="include/util.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
function error(str) {
|
||||
@@ -226,7 +228,10 @@
|
||||
|
||||
|
||||
/* If no builtin websockets then load web_socket.js */
|
||||
if (! window.WebSocket) {
|
||||
if (window.WebSocket) {
|
||||
VNC_native_ws = true;
|
||||
} else {
|
||||
VNC_native_ws = false;
|
||||
console.log("Loading web-socket-js flash bridge");
|
||||
var extra = "<script src='include/web-socket-js/swfobject.js'><\/script>";
|
||||
extra += "<script src='include/web-socket-js/FABridge.js'><\/script>";
|
||||
@@ -236,7 +241,11 @@
|
||||
|
||||
window.onload = function() {
|
||||
console.log("onload");
|
||||
WebSocket.__swfLocation = "include/web-socket-js/WebSocketMain.swf";
|
||||
if (!VNC_native_ws) {
|
||||
console.log("initializing web-socket-js flash bridge");
|
||||
WebSocket.__swfLocation = "include/web-socket-js/WebSocketMain.swf";
|
||||
WebSocket.__initialize();
|
||||
}
|
||||
var url = document.location.href;
|
||||
$('host').value = (url.match(/host=([^&#]*)/) || ['',''])[1];
|
||||
$('port').value = (url.match(/port=([^&#]*)/) || ['',''])[1];
|
||||
|
||||
+4
-3
@@ -15,6 +15,7 @@ sys.path.insert(0,os.path.dirname(__file__) + "/../utils/")
|
||||
from websocket import *
|
||||
|
||||
buffer_size = 65536
|
||||
max_packet_size = 10000
|
||||
recv_cnt = send_cnt = 0
|
||||
|
||||
|
||||
@@ -76,8 +77,8 @@ def check(buf):
|
||||
|
||||
def generate():
|
||||
global send_cnt, rand_array
|
||||
length = random.randint(10, 100000)
|
||||
numlist = rand_array[100000-length:]
|
||||
length = random.randint(10, max_packet_size)
|
||||
numlist = rand_array[max_packet_size-length:]
|
||||
# Error in length
|
||||
#numlist.append(5)
|
||||
chksum = sum(numlist)
|
||||
@@ -156,7 +157,7 @@ if __name__ == '__main__':
|
||||
|
||||
print "Prepopulating random array"
|
||||
rand_array = []
|
||||
for i in range(0, 100000):
|
||||
for i in range(0, max_packet_size):
|
||||
rand_array.append(random.randint(0, 9))
|
||||
|
||||
settings['listen_port'] = listen_port
|
||||
|
||||
Reference in New Issue
Block a user