0

XMPPのBOSHトランスポートプロトコルで使用されるSIDとRIDの値を抽出するにはどうすればよいですか?具体的には、xmpphpを使用しています。

4

2 に答える 2

2

私は XMPPHP、特にその BOSH 部分 (最近まで機能しませんでした) でかなりの作業を行いました。http://github.com/Wordi/xmpphp

私の場合、これを使用して UI クライアントをブートストラップし、XMPP BOSH の自動ログイン機能を提供しています。

class Library_BOSH extends XMPPHP_BOSH
{

    public function getAutoLoginInfo()
    {
        return array(
            "jid" => $this->fulljid,
            "rid" => $this->rid,
            "sid" => current( $this->sid )
        );
    }

    //we want to block saving the BOSH session into our $_SESSION,
    //since we're just using it to bootstrap the UI client
    public function saveSession(){;}

}

$bosh = new Library_BOSH(
    $server_address, $server_port,
    $jid, $password,
    NULL, NULL, FALSE, XMPPHP_Log::LEVEL_VERBOSE
);

$bosh->connect( "http://myboshdomain.com/http-bind/", 60 );
$bosh->processUntil('session_start', 5);

$bosh_info = $bosh->getAutoLoginInfo();
于 2010-09-13T18:33:40.933 に答える
0

接続されている bosh クライアントの「sid」と「rid」を抽出しようとしていますか? はいの場合、通常、これらは php セッションまたはブラウザーの Cookie に保存されます。私は xmpphp を使用していませんが、クライアントのセッション情報をダンプして内容を確認することができます。

于 2010-09-12T22:52:42.303 に答える