Changed from ww/s to socket.io http/s
authorDarren <darren@darrenwhitlen.com>
Sun, 17 Jul 2011 15:03:35 +0000 (16:03 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 17 Jul 2011 15:03:35 +0000 (16:03 +0100)
index.php
js/gateway.js

index e96e89d7d023be8711ccaaef9fcf62d28ece9c26..3994fd0baae8290e8bff7a89ae30e8290f14d410 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,7 @@
 <?php\r
 \r
+       $node_config = json_decode(file_get_contents("node/config.json"), true);\r
+\r
        switch(true){\r
                case stripos($_SERVER['HTTP_USER_AGENT'], 'android') > 0:\r
                        $agent = "android"; $touchscreen = true;\r
@@ -64,7 +66,7 @@
        var agent = '<?php echo $agent; ?>';\r
        var touchscreen = <?php echo ($touchscreen) ? 'true' : 'false'; ?>;\r
        var init_data = {};\r
-       var kiwi_server = 'wss://<?php echo $node_server; ?>:7777/';\r
+       var kiwi_server = '<?php echo ($node_config['listen_ssl'] ? "https" : "http")."://".$node_server; ?>:7777/';\r
        var touch_scroll;\r
        \r
        $(document).ready(function(){\r
index 585c207ba3e53f8b5369cb8b71b7097e3e9db97e..46d6e51b3ae09cd446a5ac0e7d3bdd8c92d68427 100644 (file)
@@ -21,7 +21,6 @@ var gateway = {
             gateway.socket.on('message', gateway.parse);
             gateway.socket.on('disconnect', function () {
                 // Teardown procedure here
-                // TODO: Ask Ehm if teardown with socket.io is required
                 $(gateway).trigger("ondisconnect", {});
             });
         });