projects
/
brisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ac0c59
)
add secure socket as default transport and set the default port based on 'X-Forward...
author
Matteo Nastasi
<nastasi@alternativeoutput.it>
Wed, 11 Jan 2017 18:16:53 +0000
(18:16 +0000)
committer
Matteo Nastasi
<nastasi@alternativeoutput.it>
Wed, 11 Jan 2017 18:22:26 +0000
(18:22 +0000)
web/Obj/transports.phh
patch
|
blob
|
history
web/briskin5/Obj/briskin5.phh
patch
|
blob
|
history
web/briskin5/index.php
patch
|
blob
|
history
web/commons.js
patch
|
blob
|
history
web/index.php
patch
|
blob
|
history
web/xynt-streaming.js
patch
|
blob
|
history
diff --git
a/web/Obj/transports.phh
b/web/Obj/transports.phh
index
69fe089
..
3422c23
100644
(file)
--- a/
web/Obj/transports.phh
+++ b/
web/Obj/transports.phh
@@
-609,8
+609,8
@@
class Transport {
static function create($transp)
{
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();
}
else if ($transp == 'xhr') {
return new Transport_xhr();
@@
-632,4
+632,4
@@
class Transport {
}
}
}
}
}
}
-?>
\ No newline at end of file
+?>
diff --git
a/web/briskin5/Obj/briskin5.phh
b/web/briskin5/Obj/briskin5.phh
index
a058ad0
..
0b61781
100644
(file)
--- a/
web/briskin5/Obj/briskin5.phh
+++ b/
web/briskin5/Obj/briskin5.phh
@@
-1479,7
+1479,7
@@
class Bin5 {
case "":
case "index.php":
ob_start();
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();
$content = ob_get_contents();
ob_end_clean();
diff --git
a/web/briskin5/index.php
b/web/briskin5/index.php
index
80bc798
..
80f7366
100644
(file)
--- a/
web/briskin5/index.php
+++ b/
web/briskin5/index.php
@@
-46,9
+46,13
@@
$mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.<br> Sc
);
);
-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;
{
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)
if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
unset ($table_idx);
if (($laststate = gpcs_var('laststate', $get, $post, $cookie)) === FALSE)
@@
-110,7
+114,7
@@
window.onload = function() {
preferences_update();
sess = "<?php echo "$sess"; ?>";
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;
xstm.hbit_set(heartbit);
window.onbeforeunload = onbeforeunload_cb;
diff --git
a/web/commons.js
b/web/commons.js
index
8f3253c
..
d1d2318
100644
(file)
--- a/
web/commons.js
+++ b/
web/commons.js
@@
-1393,7
+1393,6
@@
function url_complete(parent, url)
}
// alert("host: ["+host+"] path: ["+path+"]");
}
// 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);
}
if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/' || url.substring(0,5) == 'wss:/') {
return (url);
}
diff --git
a/web/index.php
b/web/index.php
index
21adca2
..
510a184
100644
(file)
--- a/
web/index.php
+++ b/
web/index.php
@@
-344,6
+344,9
@@
function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f
GLOBAL $G_lang, $G_lng, $mlang_room;
GLOBAL $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER, $_COOKIE;
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)
if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
$sess = "";
if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
@@
-1234,7
+1237,7
@@
cookie_law(null);
sidebanners_init($G_sidebanner_idx);
?>
sess = "<?php echo "$sess"; ?>";
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;
xstm.hbit_set(heartbit);
tra = new train($('room_tit'));
window.onunload = onunload_cb;
diff --git
a/web/xynt-streaming.js
b/web/xynt-streaming.js
index
3db25a1
..
47059a4
100644
(file)
--- a/
web/xynt-streaming.js
+++ b/
web/xynt-streaming.js
@@
-634,7
+634,7
@@
xynt_streaming.prototype = {
// DEFAULT TRANSPORT PROTOCOL HERE websocketsec, websocket
if (this.transp_fback > 0) {
transp_type = "websocketsec";
// 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;
}
else {
transp_type = this.transp_type;