Discussion:
Can't bind to bosh service from strophe.js basic demo
j***@public.gmane.org
2013-06-15 15:22:22 UTC
Permalink
Hi Everybody,

I'm new to Prosody. I installed ProsodySetup-0.8.2.exe. Prosody is easy
to configure on Windows and I managed to get it to work with Miranda IM.
But I encountered some problems trying to connect to the BOSH service from
strophe.js basic demo. I've followed the steps shown in
http://prosody.im/doc/strophejs, uploaded strophe.js and the example files
to my website. Strophe.js was able to connect to the BOSH listener, but
was rejected. Would appreciate any pointers. :)

ps: I've also attached the full prosody log.

Prosody Log:
Jun 15 23:12:27 socket debug server.lua: accepted new client connection
from 220.255.4.29:12139 to 5280
Jun 15 23:12:27 httpserver debug Sending response to 02A6A410
Jun 15 23:12:27 httpserver debug Destroying request 02A6A410
Jun 15 23:12:27 httpserver debug Request has no destroy callback
Jun 15 23:12:27 socket debug server.lua: closed client handler and removed
socket from list
Jun 15 23:12:27 httpserver debug Destroying request 02A6A410

Strophe.js Log:
Strophe is connecting.
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>

Rgds,
Joshua
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send an email to prosody-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/groups/opt_out.
Waqas Hussain
2013-06-15 23:50:26 UTC
Permalink
Post by j***@public.gmane.org
Hi Everybody,
I'm new to Prosody. I installed ProsodySetup-0.8.2.exe. Prosody is easy to
configure on Windows and I managed to get it to work with Miranda IM. But I
encountered some problems trying to connect to the BOSH service from
strophe.js basic demo. I've followed the steps shown in
http://prosody.im/doc/strophejs, uploaded strophe.js and the example files
to my website. Strophe.js was able to connect to the BOSH listener, but was
rejected. Would appreciate any pointers. :)
ps: I've also attached the full prosody log.
Jun 15 23:12:27 socket debug server.lua: accepted new client connection from
220.255.4.29:12139 to 5280
Jun 15 23:12:27 httpserver debug Sending response to 02A6A410
Jun 15 23:12:27 httpserver debug Destroying request 02A6A410
Jun 15 23:12:27 httpserver debug Request has no destroy callback
Jun 15 23:12:27 socket debug server.lua: closed client handler and removed
socket from list
Jun 15 23:12:27 httpserver debug Destroying request 02A6A410
Strophe is connecting.
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
SENT: <body rid='2217753051' xmlns='http://jabber.org/protocol/httpbind'
to='company.com' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
Rgds,
Joshua
I've added a note regarding unencrypted plain-text auth to
http://prosody.im/doc/strophejs, see if it applies to you.

If that doesn't fix it, the initial strophe and Prosody connection log
would be helpful (the logs you included are from after the interesting
stuff has happened).

--
Waqas Hussain
j***@public.gmane.org
2013-06-16 06:00:00 UTC
Permalink
Hi Waqas,

Thanks for replying. :) Yes, I've attached the prosody.log file
(attachment file) in my first post

I managed to get pass the previous problem by setting "cross_domain_bosh =
true". ps: I'm running Prosody on my desktop and strophe on my website and
using the latest Chrome version 27.0.1453.110.

Now i'm facing another issue.

Prosody Log (also see full log attached in file):

Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 debug Received[c2s]:
<iq id='_session_auth_2' type='set'>
Jun 16 13:48:18 mod_bosh debug We have an open request, so sending on that
Jun 16 13:48:18 httpserver debug Sending response to 02B20BF0
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 mod_bosh debug Destroying the request now...
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 mod_bosh debug Session 8d5037c8-ca5d-4825-aa45-a3009ca9da46
has 0 out of 1 requests open
Jun 16 13:48:18 mod_bosh debug and there are 0 things in the send_buffer
Jun 16 13:48:18 socket debug server.lua: accepted new client connection
from 220.255.4.26:52899 to 5280
Jun 16 13:48:18 mod_bosh debug BOSH body open (sid:
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info BOSH client
disconnected
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info Destroying
session for joshua.lim-//Bz/+***@public.gmane.org/8b5ec3ac-6164-4348-8810-a87f00872534
(joshua.lim-//Bz/+***@public.gmane.org)
Jun 16 13:48:18 sessionmanager debug All resources of joshua.lim are now
offline
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>

Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B22180
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 socket debug server.lua: accepted new client connection
from 220.255.4.26:62148 to 5280
Jun 16 13:48:18 mod_bosh debug BOSH body open (sid:
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 mod_bosh info Client tried to use sid
'8d5037c8-ca5d-4825-aa45-a3009ca9da46' which we don't know about
Jun 16 13:48:18 httpserver debug Sending response to 02B23580
Jun 16 13:48:18 httpserver debug Destroying request 02B23580
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>

Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B23580


Strophe Log (also see full log attached in file):

RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_bind_auth_2' type='result'><bind
xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>joshua.lim-//Bz/+***@public.gmane.org/8b5ec3ac-6164-4348-8810-a87f00872534</jid></bind></iq></body>
SENT: <body rid='3857589163' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq type='set'
id='_session_auth_2' xmlns='jabber:client'><session
xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_session_auth_2' type='result'
to='joshua.lim-//Bz/+***@public.gmane.org/8b5ec3ac-6164-4348-8810-a87f00872534'/></body>
Strophe is connected.
Strophe is disconnecting.
SENT: <body rid='3857589164' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46' type='terminate'><presence
xmlns='jabber:client' type='unavailable'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate'
condition='item-not-found'/>
Strophe is disconnected.
Post by Waqas Hussain
I've added a note regarding unencrypted plain-text auth to
http://prosody.im/doc/strophejs, see if it applies to you.
If that doesn't fix it, the initial strophe and Prosody connection log
would be helpful (the logs you included are from after the interesting
stuff has happened).
--
Waqas Hussain
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send an email to prosody-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/groups/opt_out.
Waqas Hussain
2013-06-16 07:36:11 UTC
Permalink
Post by j***@public.gmane.org
Hi Waqas,
Thanks for replying. :) Yes, I've attached the prosody.log file
(attachment file) in my first post
I managed to get pass the previous problem by setting "cross_domain_bosh =
true". ps: I'm running Prosody on my desktop and strophe on my website and
using the latest Chrome version 27.0.1453.110.
Now i'm facing another issue.
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 debug
Received[c2s]: <iq id='_session_auth_2' type='set'>
Jun 16 13:48:18 mod_bosh debug We have an open request, so sending on that
Jun 16 13:48:18 httpserver debug Sending response to 02B20BF0
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 mod_bosh debug Destroying the request now...
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 mod_bosh debug Session 8d5037c8-ca5d-4825-aa45-a3009ca9da46
has 0 out of 1 requests open
Jun 16 13:48:18 mod_bosh debug and there are 0 things in the send_buffer
Jun 16 13:48:18 socket debug server.lua: accepted new client connection from
220.255.4.26:52899 to 5280
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info BOSH client
disconnected
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info Destroying
Jun 16 13:48:18 sessionmanager debug All resources of joshua.lim are now
offline
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>
Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B22180
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 socket debug server.lua: accepted new client connection from
220.255.4.26:62148 to 5280
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 mod_bosh info Client tried to use sid
'8d5037c8-ca5d-4825-aa45-a3009ca9da46' which we don't know about
Jun 16 13:48:18 httpserver debug Sending response to 02B23580
Jun 16 13:48:18 httpserver debug Destroying request 02B23580
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and removed
socket from list
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>
Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B23580
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_bind_auth_2' type='result'><bind
SENT: <body rid='3857589163' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq type='set'
id='_session_auth_2' xmlns='jabber:client'><session
xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_session_auth_2' type='result'
Strophe is connected.
Strophe is disconnecting.
SENT: <body rid='3857589164' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46' type='terminate'><presence
xmlns='jabber:client' type='unavailable'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate'
condition='item-not-found'/>
Strophe is disconnected.
I don't see the problem. Strophe is successfully logging in. And then
strophe is logging out. That is, the client is intentionally
disconnecting when it says "Strophe is disconnecting". If you don't
want it to disconnect, remove the code which causes the disconnect.

--
Waqas Hussain
j***@public.gmane.org
2013-06-17 10:04:40 UTC
Permalink
Hi Waqas, thanks.
Post by j***@public.gmane.org
Post by j***@public.gmane.org
Hi Waqas,
Thanks for replying. :) Yes, I've attached the prosody.log file
(attachment file) in my first post
I managed to get pass the previous problem by setting "cross_domain_bosh
=
Post by j***@public.gmane.org
true". ps: I'm running Prosody on my desktop and strophe on my website
and
Post by j***@public.gmane.org
using the latest Chrome version 27.0.1453.110.
Now i'm facing another issue.
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 debug
Received[c2s]: <iq id='_session_auth_2' type='set'>
Jun 16 13:48:18 mod_bosh debug We have an open request, so sending on
that
Post by j***@public.gmane.org
Jun 16 13:48:18 httpserver debug Sending response to 02B20BF0
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and
removed
Post by j***@public.gmane.org
socket from list
Jun 16 13:48:18 mod_bosh debug Destroying the request now...
Jun 16 13:48:18 httpserver debug Destroying request 02B20BF0
Jun 16 13:48:18 mod_bosh debug Session
8d5037c8-ca5d-4825-aa45-a3009ca9da46
Post by j***@public.gmane.org
has 0 out of 1 requests open
Jun 16 13:48:18 mod_bosh debug and there are 0 things in the send_buffer
Jun 16 13:48:18 socket debug server.lua: accepted new client connection
from
Post by j***@public.gmane.org
220.255.4.26:52899 to 5280
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info BOSH
client
Post by j***@public.gmane.org
disconnected
Jun 16 13:48:18 bosh8d5037c8-ca5d-4825-aa45-a3009ca9da46 info Destroying
Jun 16 13:48:18 sessionmanager debug All resources of joshua.lim are now
offline
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>
Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B22180
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and
removed
Post by j***@public.gmane.org
socket from list
Jun 16 13:48:18 socket debug server.lua: accepted new client connection
from
Post by j***@public.gmane.org
220.255.4.26:62148 to 5280
8d5037c8-ca5d-4825-aa45-a3009ca9da46)
Jun 16 13:48:18 mod_bosh info Client tried to use sid
'8d5037c8-ca5d-4825-aa45-a3009ca9da46' which we don't know about
Jun 16 13:48:18 httpserver debug Sending response to 02B23580
Jun 16 13:48:18 httpserver debug Destroying request 02B23580
Jun 16 13:48:18 httpserver debug Request has destroy callback
Jun 16 13:48:18 socket debug server.lua: closed client handler and
removed
Post by j***@public.gmane.org
socket from list
Jun 16 13:48:18 mod_bosh debug BOSH stanza received: <presence
type='unavailable'>
Jun 16 13:48:18 httpserver debug Request handler provided no response,
destroying request...
Jun 16 13:48:18 httpserver debug Destroying request 02B23580
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_bind_auth_2' type='result'><bind
xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>
SENT: <body rid='3857589163' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq type='set'
id='_session_auth_2' xmlns='jabber:client'><session
xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
xmlns:stream='http://etherx.jabber.org/streams'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46'><iq xmlns='jabber:client'
id='_session_auth_2' type='result'
Strophe is connected.
Strophe is disconnecting.
SENT: <body rid='3857589164' xmlns='http://jabber.org/protocol/httpbind'
sid='8d5037c8-ca5d-4825-aa45-a3009ca9da46' type='terminate'><presence
xmlns='jabber:client' type='unavailable'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'
type='terminate'
Post by j***@public.gmane.org
condition='item-not-found'/>
Strophe is disconnected.
I don't see the problem. Strophe is successfully logging in. And then
strophe is logging out. That is, the client is intentionally
disconnecting when it says "Strophe is disconnecting". If you don't
want it to disconnect, remove the code which causes the disconnect.
--
Waqas Hussain
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send an email to prosody-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...