views:

103

answers:

2

How do I extract the SID and RID values used in the BOSH transport protocol for XMPP? Specifically, I'm using xmpphp.

A: 

Are you looking to extract the "sid" and "rid" for your connected bosh client? If yes, generally these are saved in php sessions or browser cookies. I haven't used xmpphp, but you can just try to dump client's session info to see it's content.

Abhinav Singh
I want to know how I can even connect.
Well in that case all i can suggest is to try out working BoshChat and BoshMUChat application using Jaxl library (http://github.com/abhinavsingh/JAXL), i have little experience with xmpphp.
Abhinav Singh
+1  A: 

I've done quite a bit of work on XMPPHP especially the BOSH part of it (which until recently didn't even work). http://github.com/Wordi/xmpphp

In my case, I'm using it to bootstrap a UI client and provide auto-login capability for 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();
Kendall Hopkins
Thank you very much