agl-service-unicens: fix streaming alignment issue
[apps/agl-service-unicens.git] / htdocs / AFB-websock.js
index e77ec89..99ab3b8 100644 (file)
@@ -1,7 +1,10 @@
+var urlws;
+var urlhttp;
+
 AFB = function(base, initialtoken){
 
-var urlws = "ws://"+window.location.host+"/"+base;
-var urlhttp = "http://"+window.location.host+"/"+base;
+urlws = "ws://"+window.location.host+"/"+base;
+urlhttp = "http://"+window.location.host+"/"+base;
 
 /*********************************************/
 /****                                     ****/
@@ -120,14 +123,14 @@ var AFB_websocket;
                switch (code) {
                case RETOK:
                        reply(this.pendings, id, ans, 0);
-                       break; 
+                       break;
                case RETERR:
                        reply(this.pendings, id, ans, 1);
-                       break; 
+                       break;
                case EVENT:
                default:
                        fire(this.awaitens, id, ans);
-                       break; 
+                       break;
                }
        }