Openfire的JAXL问题

时间:2016-10-27 10:44:46

标签: php xmpp jaxl prebinding

Hello XMPP / JAXL专家, 我正在尝试在以下环境中使用JAXL设置预绑定:

  • CentOS 6.x - PHP 5.3.3
  • Openfire 4.0.3(BOSH服务器已激活)
  • Jaxl 3.0.1
  • Converse.js

没有prebindind(并且没有jaxl)一切似乎运行顺利,但由于某种原因我无法使jaxl工作。 当我尝试启动echo_bosh_bot时,我收到以下错误:

[root@dev examples]# php echo_bosh_bot.php chat@localhost chat
jaxl:160 - 2016-10-27 09:43:32 - strict mode enabled, adding exception handlers. ' .
                'Set 'strict' => false inside JAXL config to disable this
jaxl:203 - 2016-10-27 09:43:33 - created pid file /software/JAXL-master/examples/.jaxl/run/jaxl_6116.pid
jaxl_exception:48 - 2016-10-27 09:43:33 - got jaxl exception construct with Argument 1 passed to JAXL::require_xep() must be an array, string given, called in /software/JAXL-master/src/JAXL/jaxl.php on line 228 and defined, 4096, /software/JAXL-master/src/JAXL/jaxl.php, 282
jaxl:250 - 2016-10-27 09:43:33 - cleaning up pid and unix sock files
[root@dev examples]# ^C
[root@dev examples]#

显然,预习也不顺利;当我运行prebind.php时,我得到200 OK,但在回复中我得到了

syntax error: JSON.parse: Unexpected end of data at line 1 column 1 of the json data

这是我的prebind.php文件:

<?php

header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json; charset=utf-8');

date_default_timezone_set('Europe/Rome');

require '/software/JAXL-master/vendor/autoload.php';
require '/software/JAXL-master/src/JAXL/jaxl.php';

$client = new JAXL(array(
    'jid'=>'chat@localhost',
    'pass'=>'chat',
    'bosh_url' => 'http://localhost/http-bind'
));


$client ->add_cb('on_auth_success', function(){
    global $client;

    $array = array(      
        //'rid' => $client->xeps['0206']->rid,
        //'sid' => (string)$client->xeps['0206']->sid,
        'jid'=> $client->jid->to_string(),
        'bosh_url' => 'http://localhost/http-bind'
    );

    echo json_encode($array); 
    exit;

 });
$client->add_cb('on_auth_failure', function($reason) {
global $client;
    echo("got on_auth_failure cb with reason $reason");
$client->send_end_stream();
});

$client->start();

echo "done";

?>

非常感谢任何帮助 - 谢谢

Giulio的

0 个答案:

没有答案