diff --git a/test/websocket.xhtml b/test/websocket.xhtml
index 87b9753c..52c49ffd 100644
--- a/test/websocket.xhtml
+++ b/test/websocket.xhtml
@@ -20,6 +20,27 @@
var hand_hour;
var hand_min;
+ function queryStringElem(name, idx) {
+ if (typeof(queryStringElem_Table) != "object") {
+ queryStringElem_Table = {};
+ window.location.search.slice(1).split('&').forEach(
+ function(keyValuePair) {
+ keyValuePair = keyValuePair.split('=');
+ if (typeof(queryStringElem_Table[keyValuePair[0]]) != "object") {
+ queryStringElem_Table[keyValuePair[0]] = [];
+ }
+ var idx = queryStringElem_Table[keyValuePair[0]].length+1;
+ queryStringElem_Table[keyValuePair[0]][idx] = keyValuePair[1] || '';
+ }
+ );
+ }
+ idx = idx || 1;
+ if (queryStringElem_Table[name]) {
+ return queryStringElem_Table[name][idx];
+ }
+ return null;
+ }
+
function webSockKeepAlive() {
if (keepAlive) {
connection.send('client still alive');
@@ -35,8 +56,16 @@
hand_min = document.getElementById('hand_min');
hand_hour = document.getElementById('hand_hour');
+ var ka = queryStringElem("keepAlive");
+ if (ka) {
+ use_keepAlive = (ka.toLowerCase()!="false") && (ka.toLowerCase()!=0);
+ } else {
+ use_keepAlive = true;
+ }
+
connection.onopen = function () {
- keepAlive = true;
+ keepAlive = use_keepAlive;
+ alert(keepAlive);
webSockKeepAlive();
};