done
chmod -R 777 ${proxy_path}/bin5
+ mkdir -p "${legal_path}"
+ chmod 777 "${legal_path}"
fi
install -d ${web_path}__
for i in $(find web -type d | grep '/' | sed 's/^....//g'); do
for i in $(find web -name '.htaccess' -o -name '*.php' -o -name '*.phh' -o -name '*.pho' -o -name '*.css' -o -name '*.js' -o -name '*.mp3' -o -name '*.swf' -o -name 'terms-of-service*' | sed 's/^....//g'); do
install -m 644 "web/$i" "${web_path}__/$i"
done
+
+# hardlink for nginx managed websocket files.
+ln "${web_path}__/xynt_test01.php" "${web_path}__/xynt_test01_wss.php"
+
if [ "$test_add" = "TRUE" ]; then
for i in $(find webtest -name '.htaccess' -o -name '*.php' -o -name '*.phh' -o -name '*.pho' -o -name '*.css' -o -name '*.js' -o -name '*.mp3' -o -name '*.swf' -o -name 'terms-of-service*' | sed 's/^........//g'); do
install -m 644 "webtest/$i" "${web_path}__/$i"
ProxyPassMatch ^/brisk/.*\.(png|gif|jpg|css|js)$ !
ProxyPass /brisk/briskin5/index_rd.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
+ ProxyPass /brisk/briskin5/index_rd_wss.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/briskin5/index_wr.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/briskin5/briskin5/index.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/briskin5/index.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/index_rd.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
+ ProxyPass /brisk/index_rd_wss.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/index_wr.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
ProxyPass /brisk/index.php fd:///var/www/brisk-priv/brisk.sock keepalive=Off connectiontimeout=5 timeout=30
--------
break;
case "index_rd.php":
+ case "index_rd_wss.php":
if (($transp = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
$transp = "iframe";
- if ($transp == 'websocket')
+ if ($transp == 'websocket' || $transp == 'websocketsec')
$enc = 'plain';
do {
$subs = "briskin5/";
$subs_l = strlen($subs);
if (!strncmp($path, $subs, $subs_l)) {
- $ret = Bin5::request_mgr(&$s_a_p, $header, &$header_out, &$new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie);
+ $ret = Bin5::request_mgr($s_a_p, $header, $header_out, $new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie);
return ($ret);
}
break;
}
if ($chals->ismod()) {
- Challenges::save_data(&$chals);
+ Challenges::save_data($chals);
}
Challenges::unlock_data($a_sem);
}
if ($chals->ismod()) {
- Challenges::save_data(&$chals);
+ Challenges::save_data($chals);
}
Challenges::unlock_data($a_sem);
}
} // for (...
if ($hban->ismod()) {
- Hardbans::save_data(&$hban);
+ Hardbans::save_data($hban);
}
} // if (load_data
Hardbans::unlock_data($a_sem);
$hban->add_item($login, $ip, $session, $timeout);
if ($hban->ismod()) {
- Hardbans::save_data(&$hban);
+ Hardbans::save_data($hban);
}
} // if (load_data
Hardbans::unlock_data($a_sem);
function pendpage_try_addcont(&$new_socket, $tout, $method, $header, $get, $post, $cookie, $path, $addr, $rest, $cont)
{
- $pendpage = PendingPage::pendingpage_continue(&$new_socket, $this->curtime, $tout, $method,
+ $pendpage = PendingPage::pendingpage_continue( $new_socket, $this->curtime, $tout, $method,
$header, $get, $post, $cookie,
$path, $addr, $rest, $cont);
return cmd_return(401, 'malformed cmd');
}
$idx = -1;
- if (($user = $this->app->get_user($cmd['sess'], &$idx)) == FALSE)
+ if (($user = $this->app->get_user($cmd['sess'], $idx)) == FALSE)
return cmd_return(402, 'user not found');
if (($user->flags & USER_FLAG_TY_ADMIN) == 0x00)
class Transport_websocket {
protected $magicGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
- function Transport_websocket() {
+ function Transport_websocket($secure = FALSE) {
$this->headerOriginRequired = false;
$this->headerSecWebSocketProtocolRequired = false;
$this->headerSecWebSocketExtensionsRequired = false;
}
if (!isset($headers['Host']) || !$this->checkHost($headers['Host'])) {
+ // error_log('bad 1');
$headers_out['HTTP-Response'] = "400 Bad Request";
}
if (!isset($headers['Upgrade']) || strtolower($headers['Upgrade']) != 'websocket') {
+ // error_log('bad 2 ' . $headers['Upgrade']);
$headers_out['HTTP-Response'] = "400 Bad Request";
}
if (!isset($headers['Connection']) || strpos(strtolower($headers['Connection']), 'upgrade') === FALSE) {
+ // error_log('bad 3');
$headers_out['HTTP-Response'] = "400 Bad Request";
}
if (!isset($headers['Sec-Websocket-Key'])) {
+ // error_log('bad 4');
$headers_out['HTTP-Response'] = "400 Bad Request";
} else {
}
if ( ($this->headerSecWebSocketProtocolRequired && !isset($headers['Sec-Websocket-Protocol']))
|| ($this->headerSecWebSocketProtocolRequired &&
!$this->checkWebsocProtocol($headers['Sec-Websocket-Protocol']))) {
+ // error_log('bad 5');
$headers_out['HTTP-Response'] = "400 Bad Request";
}
if ( ($this->headerSecWebSocketExtensionsRequired && !isset($headers['Sec-Websocket-Extensions']))
|| ($this->headerSecWebSocketExtensionsRequired &&
!$this->checkWebsocExtensions($headers['Sec-Websocket-Extensions'])) ) {
+ // error_log('bad 6');
$headers_out['HTTP-Response'] = "400 Bad Request";
}
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
+?>
$this->rd_data_set($curtime, $transp, $enc, $stat, $subst, $step, $from);
- $ret = $this->rd_transp->init($enc, $header, &$header_out, $init_string, self::base_get(), $this->rd_scristp);
+ $ret = $this->rd_transp->init($enc, $header, $header_out, $init_string, self::base_get(), $this->rd_scristp);
if ($ret === FALSE) {
return FALSE;
$this->mazzo = $match_data['mazzo_next'];
$this->mult = $match_data['mult_next'];
$this->match_id = $match_id;
- $this->game_init(&$bri->user);
+ $this->game_init($bri->user);
/* reload of the page with the new layout */
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur->comm[$user_cur->step % COMM_N] = "";
$user_cur->step_inc();
- $user_cur->comm[$user_cur->step % COMM_N] = show_table(&$bri, &$user_cur, $user_cur->step+1, TRUE, FALSE);
+ $user_cur->comm[$user_cur->step % COMM_N] = show_table($bri, $user_cur, $user_cur->step+1, TRUE, FALSE);
$user_cur->step_inc();
}
return (TRUE);
log_load("RESYNC");
/* NOTE: $this->room is associated with the current $bri object */
printf("xXx CLASS NAME [%s]\n", get_class($this->room));
- $ret = show_table(&$this->room, $this, $this->step, FALSE, FALSE);
+ $ret = show_table($this->room, $this, $this->step, FALSE, FALSE);
}
log_rd2("NEWSTAT: ".$this->stat);
$user[$table->player[$i]]->table_token = $table_token;
$this->user[$i] = Bin5_user::spawn($user[$table->player[$i]], $this, $table_idx, $i, $get, $post, $cookie);
}
- $this->table[0] = Bin5_table::spawn(&$table);
+ $this->table[0] = Bin5_table::spawn($table);
log_main("TABLE_OLD_WIN - Bin5:".$this->table[0]->old_asta_win);
$user_cur->the_end = TRUE;
/* se gli altri utenti non erano d'accordo questo utente viene bannato */
- $remcalc = $this->table[0]->exitlock_calc(&$this->user, $user_cur->table_pos);
+ $remcalc = $this->table[0]->exitlock_calc($this->user, $user_cur->table_pos);
if ($remcalc < 3) {
require_once("${G_base}Obj/hardban.phh");
Hardbans::add(($user_cur->is_auth() ? $user_cur->name : FALSE),
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();
break;
case "index_rd.php":
+ case "index_rd_wss.php":
if (($transp = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
$transp = "iframe";
- if ($transp == 'websocket')
+ if ($transp == 'websocket' || $transp == 'websocketsec')
$enc = 'plain';
do {
$table_pos = $user->table_pos;
$ret = "table_init();";
- $ret .= $table->exitlock_show(&$bri->user, $table_pos);
+ $ret .= $table->exitlock_show($bri->user, $table_pos);
if (!$is_again) {
/* GENERAL STATUS */
$user_rules = $user->rules_get();
}
/* NOTIFY FOR THE CARD MAKER */
if ($is_transition) { // && $user->subst == "asta" superfluo
- $ret .= show_table_info(&$bri, &$table, $table_pos);
+ $ret .= show_table_info($bri, $table, $table_pos);
$ret .= "setTimeout(preload_images, 500, g_preload_img_arr, g_imgct);";
}
else {
);
-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;
log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
- if (($user = &$bin5->get_user($sess, &$idx)) == FALSE) {
+ if (($user = &$bin5->get_user($sess, $idx)) == FALSE) {
echo "Get User Error";
log_wr("Get User Error");
return FALSE;
if ($argz[0] == 'tableinfo') {
log_wr("PER DI TABLEINFO");
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= show_table_info(&$bin5, &$table, $user->table_pos);
+ $user->comm[$user->step % COMM_N] .= show_table_info($bin5, $table, $user->table_pos);
log_wr($user->comm[$user->step % COMM_N]);
$user->step_inc();
}
else if ($argz[0] == 'chatt') {
- $bin5->chatt_send(&$user, $mesg);
+ $bin5->chatt_send($user, $mesg);
}
else if ($argz[0] == 'preferences_update') {
log_wr("PER DI PREFERENCES_UPDATE");
$logout_cont = TRUE;
if ($remcalc >= 3) {
- $lockcalc = $table->exitlock_calc(&$bin5->user, $user->table_pos);
+ $lockcalc = $table->exitlock_calc($bin5->user, $user->table_pos);
if ($lockcalc < 3) {
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= $table->exitlock_show(&$bin5->user, $user->table_pos);
+ $user->comm[$user->step % COMM_N] .= $table->exitlock_show($bin5->user, $user->table_pos);
$user->comm[$user->step % COMM_N] .= show_notify("<br>I dati presenti sul server non erano allineati con quelli inviati dal tuo browser, adesso lo sono. Riprova ora.", 2000, "torna alla partita.", 400, 100);
log_wr($user->comm[$user->step % COMM_N]);
}
else if ($user->subst == 'asta') {
if ($argz[0] == 'lascio') {
- if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
+ if ($table->rules->engine($bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d;', $user_cur->step+1);
- $ret .= show_table(&$bin5,&$user_cur,$user_cur->step+1, TRUE, TRUE);
+ $ret .= show_table($bin5, $user_cur,$user_cur->step+1, TRUE, TRUE);
$user_cur->comm[$user_cur->step % COMM_N] = $ret;
$user_cur->step_inc();
}
if ($table->turn == (BIN5_PLAYERS_N * BIN5_CARD_HAND)) { /* game finished */
log_wr(sprintf("GIOCO FINITO !!!"));
- if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) {
+ if ($table->rules->engine($bin5, $curtime, BIN5_RULES_FINISH, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur = &$bin5->user[$table->player[$i]];
- $retar[$i] .= show_table(&$bin5,&$user_cur,$user_cur->step+1,TRUE, TRUE);
+ $retar[$i] .= show_table($bin5, $user_cur, $user_cur->step+1, TRUE, TRUE);
}
}
}
$user_cur->step_inc();
}
- log_wr(sprintf("TURN: %d",$table->turn));
+ log_wr(sprintf("TURN: %d", $table->turn));
/* Have played all the players ? */
/* NO: switch the focus and enable the next player to play. */
}
// alert("host: ["+host+"] path: ["+path+"]");
- if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/') {
+ if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/' || url.substring(0,5) == 'wss:/') {
return (url);
}
else if (url.substring(0,1) == '/') {
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)
log_main("pre garbage_manager UNO");
$brisk->garbage_manager(TRUE);
log_main("post garbage_manager");
- if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) {
+ if (($user = $brisk->get_user($sess, $idx)) != FALSE) {
if ($user->the_end == FALSE) {
$brisk->sess_cur_set($user->sess);
log_main("user stat: ".$user->stat);
/* try login */
if ($banned == FALSE &&
- ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private,
+ ($user = $brisk->add_user($sess, $idx, $name, $pass_private,
$remote_addr, $header, $cookie)) != FALSE) {
$brisk->sess_cur_set($user->sess);
$ACTION = "room";
google_color_url = "000000";
//-->
</script>
-<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
+<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
$banner_top_right = carousel_top();
}
else {
google_color_url = "000000";
//-->
</script>
-<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
+<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
}
}
else { // !$G_is_local
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;
$curtime = time();
$dt = date("H:i ", $curtime);
- if (($user = $brisk->get_user($sess, &$idx)) == FALSE) {
+ if (($user = $brisk->get_user($sess, $idx)) == FALSE) {
$argz = explode('|', xcapemesg($mesg));
if ($argz[0] == 'getchallenge') {
echo '1|';
}
if ($chals->ismod()) {
- Challenges::save_data(&$chals);
+ Challenges::save_data($chals);
}
}
if ($user->subst == 'sitdown' || $user->stat == 'table')
$brisk->room_wakeup($user);
else if ($user->subst == 'standup')
- $brisk->room_outstandup(&$user);
+ $brisk->room_outstandup($user);
else {
log_rd2("SHUTDOWN FROM WHAT ???");
}
}
else if ($argz[0] == 'chatt') {
- $brisk->chatt_send(&$user, xcapemesg($mesg), $mlang_indwr);
+ $brisk->chatt_send($user, xcapemesg($mesg), $mlang_indwr);
}
else if ($argz[0] == 'tosmgr') {
// check IF is authnticated user, both terms of service versions matches
$bin5_user_cur->trans_step = $user_cur->step + 1;
$bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = "";
$bin5_user_cur->step_inc();
- $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table(&$bin5,&$bin5_user_cur,$bin5_user_cur->step+1,TRUE,FALSE);
+ $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table($bin5, $bin5_user_cur,
+ $bin5_user_cur->step+1,
+ TRUE, FALSE);
$bin5_user_cur->step_inc();
log_wr("TRY PRESAVE: ".$bin5_user_cur->step." TRANS STEP: ".$bin5_user_cur->trans_step);
//
function transport_ws(doc, xynt_streaming, page)
{
- this.name = "WebSocket";
+ // if four arguments manage if WS or WSS connection
+ if (arguments.length > 3)
+ this.is_secure = arguments[3];
+ else
+ this.is_secure = false;
+
+ if (this.is_secure)
+ this.name = "WebSocketSecure";
+ else
+ this.name = "WebSocket";
this.ctx_new = "";
var self = this;
this.failed = false;
this.xynt_streaming = xynt_streaming;
try {
-this.xynt_streaming.log("PAGE: "+page);
+ this.xynt_streaming.log("PAGE: "+page);
this.ws = new WebSocket(page);
this.ws.onopen = function () {
self.xynt_streaming.log("onopen");
// page arrangement
this.page = url_complete(this.win.location.href, this.page);
+ // DEFAULT TRANSPORT PROTOCOL HERE websocketsec, websocket
if (this.transp_fback > 0) {
- transp_type = "websocket";
- transp_port = (this.transp_fback == 2 ? 80 : 8080);
+ transp_type = "websocketsec";
+ transp_port = (this.transp_fback == 2 ? 443 : 8080);
}
else {
transp_type = this.transp_type;
transp_port = this.transp_port;
}
- if (transp_type == "websocket") {
- var end_proto, first_slash;
+ if (transp_type == "websocket" || transp_type == "websocketsec") {
+ var end_proto, first_slash, newpage;
// change protocol
this.log("precha ["+this.page+"]");
- end_proto = this.page.indexOf("://");
- first_slash = this.page.substring(end_proto+3).indexOf("/");
+ if (transp_type == "websocketsec") {
+ newpage = this.page.replace(/\.php$/g, "_wss.php").replace(/\.php\?/g, "_wss.php?");
+ }
+ else {
+ newpage = this.page;
+ }
+ end_proto = newpage.indexOf("://");
+ first_slash = newpage.substring(end_proto+3).indexOf("/");
- page = "ws://" + this.page.substring(end_proto+3, end_proto+3+first_slash) + ":" + transp_port + this.page.substring(end_proto+3 + first_slash);
+ page = (transp_type == "websocketsec" ? "wss://" : "ws://")
+ + newpage.substring(end_proto+3, end_proto+3 + first_slash) + ":"
+ + transp_port + newpage.substring(end_proto+3 + first_slash);
+ // this.log("MOP WS: " + page);
}
else {
page = this.page;
try {
// transport instantiation
- if (transp_type == "websocket") {
+ if (transp_type == "websocketsec") {
+ page = url_append_args(page, "transp", "websocketsec");
+ this.transp = new transport_ws(this.doc, this, page, true);
+ }
+ else if (transp_type == "websocket") {
page = url_append_args(page, "transp", "websocket");
this.transp = new transport_ws(this.doc, this, page);
}
<?php
+foreach (array('isstream', 'f_test', 'f_trans', 'f_port', 'f_fback', 'sess', 'stat',
+ 'subst', 'step', 'from', 'transp') as $i) {
+ if (isset($_REQUEST[$i])) {
+ $$i = $_REQUEST[$i];
+ }
+}
$desc = array( "Semplice: da 1 a 9 ogni secondo, poi ricomincia (status sempre verde).",
"Continuo: da 1 a N ogni secondo, ricomincia ogni 9 (status sempre verde).",
return (TRUE);
}
-$transs = array( "iframe", "websocket", "xhr", "htmlfile" );
+$transs = array( "iframe", "websocket", "websocketsec", "xhr", "htmlfile" );
+$trans_ports = array( "iframe"=>80, "websocket"=>80, "websocketsec"=>443, "xhr"=>80, "htmlfile"=>80 );
if (!isset($f_trans))
$f_trans = $transs[0];
$f_test = 1;
if (!isset($f_port))
- $f_port = 80;
+ $f_port = NULL;
if (!isset($f_fback))
$f_fback = 0;
}
if (isset($isstream) && $isstream == "true") {
-
require_once("Obj/transports.phh");
if (isset($transp) && $transp == "websocket") {
$trobj = new Transport_websocket();
}
+ else if (isset($transp) && $transp == "websocketsec") {
+ $trobj = new Transport_websocket(TRUE);
+ }
else if (isset($transp) && $transp == "xhr") {
$trobj = new Transport_xhr();
}
$init_string .= chr(mt_rand(65, 90));
}
$headers_in = getallheaders();
+ // error_log(print_r($headers_in, TRUE));
$headers = array();
foreach ($headers_in as $header_in => $value) {
$headers[mb_convert_case($header_in, MB_CASE_TITLE, 'UTF-8')] = $value;
fclose($fp);
}
- if (isset($transp) && $transp == "websocket") {
+ if (isset($transp) && ($transp == "websocket" || $transp == "websocketsec")) {
header_remove('Connection');
header_remove('Content-Encoding');
header_remove('Content-Type');
var gst = new globst();
window.onload = function() {
- xstm = new xynt_streaming(window, "<?php echo "$f_trans";?>", <?php echo "$f_port";?>, <?php echo "$f_fback";?>, console, gst, 'xynt_test01_php', 'sess', sess, null, 'xynt_test01.php?isstream=true&f_test=<?php echo "$f_test";?>', function(com){eval(com);});
+ xstm = new xynt_streaming(window, "<?php echo "$f_trans";?>", <?php
+ echo ($f_port == NULL ? "${trans_ports[$f_trans]}" : "$f_port" );?>, <?php echo "$f_fback";?>, console, gst, 'xynt_test01_php', 'sess', sess, null, 'xynt_test01.php?isstream=true&f_test=<?php echo "$f_test";?>', function(com){eval(com);});
xstm.hbit_set(heartbit);
xstm.start();
}
<div>
<?php
-
-
printf("<table>");
for ($test = 1 ; $test <= count($desc) ; $test++) {
printf("<tr>");
foreach ($transs as $trans) {
- printf("<td style=\"padding: 8px; border: 1px solid black;\"><a href=\"?f_trans=%s&f_test=%d&f_port=%d&f_fback=%d\">Test %s %02d (port %d (fb %d))</a></td>", $trans, $test, $f_port, $f_fback, $trans, $test, $f_port, $f_fback);
+ printf("<td style=\"padding: 8px; border: 1px solid black;\"><a href=\"?f_trans=%s&f_test=%d%s&f_fback=%d\">Test %s %02d (port %d (fb %d))</a></td>", $trans, $test,
+ ($f_port == NULL ? "" : sprintf("&f_port=%d", $f_port)), $f_fback, $trans, $test,
+ ($f_port == NULL ? $trans_ports[$trans] : $f_port ), $f_fback);
}
printf("</tr>\n");
}