librelist archives

« back to archive

Fwd: BOSH | Openfire | PHP - Not working as expected

Fwd: BOSH | Openfire | PHP - Not working as expected

From:
Abdeali Kothari
Date:
2014-08-17 @ 10:24
Hi,

I've been trying to setup my own xmpp chat for the last 2 days ...
I have been able to setup + configure apache's openfire. And coverse.js
works nicely with the normal configs.

I hit a block when i tried bosh.
So, two basic steps :
1. Create jabber id when a person registers on my website :
Done using openfire's userService plugin. The user is created successfully
and can be seen in Users in the panel openfire has.

2. Prebinding ... using this code (from
https://github.com/candy-chat/xmpp-prebind-php ) :
```
$xmpp = new XmppPrebind(XMPP_HOST, XMPP_HOST_PREBIND, '', false, false);
$xmpp->connect($user_name, $user_password);
$xmpp_session = $xmpp->getSessionInfo(); // array containing sid, rid and
jid
```

---------------------------------------------
So, When I write the name and password in a non-prebind converse js ... it
works.
When I write the name and password in a prebind converse js ... it logs in
... But the "Server" field is empty and when i put the field as
`conference.localhost` and search for rooms, it keeps loading forever.


Anyone tried this before and got it working ? If so, what am i doing wrong
? Been trying for too long and am at my wits end :|

Re: [conversejs] Fwd: BOSH | Openfire | PHP - Not working as expected

From:
Jc Brand
Date:
2014-08-19 @ 08:30
On Sun, Aug 17, 2014 at 03:54:12PM +0530, Abdeali Kothari wrote:
>    Hi,
>    I've been trying to setup my own xmpp chat for the last 2 days ...
>    I have been able to setup + configure apache's openfire. And coverse.js
>    works nicely with the normal configs.
>    I hit a block when i tried bosh. 

I think you mean prebind. BOSH is used in the "normal" case as well.

>    So, two basic steps :
>    1. Create jabber id when a person registers on my website :
>    Done using openfire's userService plugin. The user is created successfully
>    and can be seen in Users in the panel openfire has.
>    2. Prebinding ... using this code (from
>    [1]https://github.com/candy-chat/xmpp-prebind-php ) :
>    ```
>    $xmpp = new XmppPrebind(XMPP_HOST, XMPP_HOST_PREBIND, '', false, false);
>    $xmpp->connect($user_name, $user_password);
>    $xmpp_session = $xmpp->getSessionInfo(); // array containing sid, rid and
>    jid
>    ```
>    ---------------------------------------------
>    So, When I write the name and password in a non-prebind converse js ... it
>    works.
>    When I write the name and password in a prebind converse js ... it logs in
>    ... But the "Server" field is empty

In the prebind case, you're not supposed to use the user's password in
converse.js. Instead, you're supposed to use the RID and SID tokens that you
got from the prebind authentication which you do server-side with PHP.

>    and when i put the field as
>    `conference.localhost` and search for rooms, it keeps loading forever.

Do you have "localhost" configured as your chat domain? Did you enable MUC and
configured "conference.localhost" as the domain for MUC?

JC

Re: [conversejs] Fwd: BOSH | Openfire | PHP - Not working as expected

From:
Abdeali Kothari
Date:
2014-08-19 @ 08:49
Ah sorry, I did use the rid, sid and jid given by the prebind. I wrote the
wrong thing by mistake

Yes, I have localhost configured. And the MUC is enabled. As I mentioned, I
am able to chat if prebind is false. So, it shouldnt be a problem with the
openfire part


On Tue, Aug 19, 2014 at 2:00 PM, JC Brand <lists@opkode.com> wrote:

> On Sun, Aug 17, 2014 at 03:54:12PM +0530, Abdeali Kothari wrote:
> >    Hi,
> >    I've been trying to setup my own xmpp chat for the last 2 days ...
> >    I have been able to setup + configure apache's openfire. And
> coverse.js
> >    works nicely with the normal configs.
> >    I hit a block when i tried bosh.
>
> I think you mean prebind. BOSH is used in the "normal" case as well.
>
> >    So, two basic steps :
> >    1. Create jabber id when a person registers on my website :
> >    Done using openfire's userService plugin. The user is created
> successfully
> >    and can be seen in Users in the panel openfire has.
> >    2. Prebinding ... using this code (from
> >    [1]https://github.com/candy-chat/xmpp-prebind-php ) :
> >    ```
> >    $xmpp = new XmppPrebind(XMPP_HOST, XMPP_HOST_PREBIND, '', false,
> false);
> >    $xmpp->connect($user_name, $user_password);
> >    $xmpp_session = $xmpp->getSessionInfo(); // array containing sid, rid
> and
> >    jid
> >    ```
> >    ---------------------------------------------
> >    So, When I write the name and password in a non-prebind converse js
> ... it
> >    works.
> >    When I write the name and password in a prebind converse js ... it
> logs in
> >    ... But the "Server" field is empty
>
> In the prebind case, you're not supposed to use the user's password in
> converse.js. Instead, you're supposed to use the RID and SID tokens that
> you
> got from the prebind authentication which you do server-side with PHP.
>
> >    and when i put the field as
> >    `conference.localhost` and search for rooms, it keeps loading forever.
>
> Do you have "localhost" configured as your chat domain? Did you enable MUC
> and
> configured "conference.localhost" as the domain for MUC?
>
> JC
>