Import/merge gimite/web-socket-js up to da7caff96496c7d7bfb3.

Bug fixes, restore RFC2817 proxy for non wss://, and handle new
closing handshake from WebSockets 76.
This commit is contained in:
Joel Martin
2010-07-02 09:52:59 -05:00
parent e091b47a9f
commit b9633f8bfd
5 changed files with 89 additions and 62 deletions

View File

@@ -292,7 +292,7 @@
WebSocket.__tasks = [];
WebSocket.__initialize = function(debug) {
WebSocket.__initialize = function() {
if (!WebSocket.__swfLocation) {
console.error("[WebSocket] set WebSocket.__swfLocation to location of WebSocketMain.swf");
return;
@@ -320,9 +320,7 @@
//console.log("[WebSocket] FABridge initializad");
WebSocket.__flash = FABridge.webSocket.root();
WebSocket.__flash.setCallerUrl(location.href);
if (typeof debug !== "undefined") {
WebSocket.__flash.setDebug(debug);
}
WebSocket.__flash.setDebug(!!WebSocket.__debug);
for (var i = 0; i < WebSocket.__tasks.length; ++i) {
WebSocket.__tasks[i]();
}
@@ -351,12 +349,12 @@
console.error(decodeURIComponent(message));
};
/*
if (window.addEventListener) {
window.addEventListener("load", WebSocket.__initialize, false);
} else {
window.attachEvent("onload", WebSocket.__initialize);
if (!WebSocket.__disableAutoInitialization) {
if (window.addEventListener) {
window.addEventListener("load", WebSocket.__initialize, false);
} else {
window.attachEvent("onload", WebSocket.__initialize);
}
}
*/
})();