Skip to content
Browse files

change in default socketio option: remember: true

	modified:   node/easyWebSocket-node.js
  • Loading branch information...
1 parent 9e44fce commit 6b00562029759896c9975e091b251b19fed7c0c7 @jeromeetienne committed
Showing with 9 additions and 11 deletions.
  1. +3 −4 easyWebSocket-node.min.js
  2. +3 −4 easyWebSocket.min.js
  3. +3 −3 node/easyWebSocket-node.js
View
7 easyWebSocket-node.min.js
@@ -102,8 +102,7 @@ function(c,e){return function(g){var k=new a;k.initEvent(e,true,true);k.target=k
"-100px"}var e=document.createElement("div");e.id="webSocketFlash";c.appendChild(e);document.body.appendChild(c);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","9.0.0",null,{bridgeName:"webSocket"},{hasPriority:true,allowScriptAccess:"always"},null,function(g){g.success||b.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__tasks=[]}catch(k){b.error("[WebSocket] "+k.toString())}})}else b.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")};WebSocket.__addTask=function(c){WebSocket.__flash?c():WebSocket.__tasks.push(c)};WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return false;var c=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!c||!c.enabledPlugin||!c.enabledPlugin.filename)return false;
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
-EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b,rememberTransport:false,transports:["websocket","flashsocket","htmlfile","xhr-multipart","xhr-polling"]});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",
-a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};
-EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};
-EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
+EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});
+a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;
+EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
7 easyWebSocket.min.js
@@ -102,8 +102,7 @@ function(c,e){return function(g){var k=new a;k.initEvent(e,true,true);k.target=k
"-100px"}var e=document.createElement("div");e.id="webSocketFlash";c.appendChild(e);document.body.appendChild(c);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","9.0.0",null,{bridgeName:"webSocket"},{hasPriority:true,allowScriptAccess:"always"},null,function(g){g.success||b.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__tasks=[]}catch(k){b.error("[WebSocket] "+k.toString())}})}else b.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")};WebSocket.__addTask=function(c){WebSocket.__flash?c():WebSocket.__tasks.push(c)};WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return false;var c=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!c||!c.enabledPlugin||!c.enabledPlugin.filename)return false;
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
-EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b,rememberTransport:false,transports:["websocket","flashsocket","htmlfile","xhr-multipart","xhr-polling"]});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",
-a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};
-EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};
-EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
+EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});
+a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;
+EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
6 node/easyWebSocket-node.js
@@ -54,9 +54,9 @@ EasyWebSocket.prototype._sioCtor = function()
// create and config the socket
this._sockio = new io.Socket(listenHost, {
- port : listenPort,
- rememberTransport : false,
- transports : ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling']
+ port : listenPort
+ //rememberTransport : false,
+ //transports : ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling']
});
this._sockio.connect();
this._sockio.on('connect', function(){

0 comments on commit 6b00562

Please sign in to comment.
Something went wrong with that request. Please try again.