static function create($transp)
{
- if ($transp == 'websocket') {
- return new Transport_websocket();
+ if ($transp == 'websocket' || $transp == 'websocketsec') {
+ return new Transport_websocket($transp == 'websocketsec');
}
else if ($transp == 'xhr') {
return new Transport_xhr();
}
}
}
-?>
\ No newline at end of file
+?>
case "":
case "index.php":
ob_start();
- bin5_index_main($transp_type, $header_out, $addr, $get, $post, $cookie);
+ bin5_index_main($transp_type, $header, $header_out, $addr, $get, $post, $cookie);
$content = ob_get_contents();
ob_end_clean();
);
-function bin5_index_main($transp_type, &$header_out, $addr, $get, $post, $cookie)
+function bin5_index_main($transp_type, $header, &$header_out, $addr, $get, $post, $cookie)
{
GLOBAL $G_lang, $mlang_bin5_index;
+
+ $transp_port = ((array_key_exists("X-Forwarded-Proto", $header) &&
+ $header["X-Forwarded-Proto"] == "https") ? 443 : 80);
+
if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
unset ($table_idx);
if (($laststate = gpcs_var('laststate', $get, $post, $cookie)) === FALSE)
preferences_update();
sess = "<?php echo "$sess"; ?>";
- xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", 80, 2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
+ xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>, 2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
xstm.hbit_set(heartbit);
window.onbeforeunload = onbeforeunload_cb;
}
// alert("host: ["+host+"] path: ["+path+"]");
- console.log('URL: ' + url);
if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/' || url.substring(0,5) == 'wss:/') {
return (url);
}
GLOBAL $G_lang, $G_lng, $mlang_room;
GLOBAL $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER, $_COOKIE;
+ $transp_port = ((array_key_exists("X-Forwarded-Proto", $header) &&
+ $header["X-Forwarded-Proto"] == "https") ? 443 : 80);
+
if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
$sess = "";
if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
sidebanners_init($G_sidebanner_idx);
?>
sess = "<?php echo "$sess"; ?>";
-xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", 80, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
+xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
xstm.hbit_set(heartbit);
tra = new train($('room_tit'));
window.onunload = onunload_cb;
// DEFAULT TRANSPORT PROTOCOL HERE websocketsec, websocket
if (this.transp_fback > 0) {
transp_type = "websocketsec";
- transp_port = (this.transp_fback == 2 ? 80 : 8080);
+ transp_port = (this.transp_fback == 2 ? 443 : 8080);
}
else {
transp_type = this.transp_type;