Hey,

I have this about 70% working I think. I have 2 servers, one is mysite.com with my drupal site. The other is talk.mysite.com with my xmpp server.

Whats working:
- I can login and create new user accounts on my xmpp server via pidgin
- my reverse proxy on talk.mysite.com to http-bind
- my drupal site creates users on xmpp just fine

Whats not working:
- cant connect with strophe to the xmpp (with basic, crossdomain, or echobot.html).

When I go to talk.mysite.com:5229/crossdomain.xml with firefox I get this error:

XML Parsing Error: not well-formed
Location: http://talk.mysite.com:5229/crossdomain.xml
Line Number 1, Column 211:

When I view the page source I can see the xml that looks like:

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy><allow-access-from domain="*" to-ports="5222" /></cross-domain-policy>

I am using openfire (I tired with ejabberd as well and had the same exact issues). I'm not sure what I need to do now. Any suggestions?

Comments

that0n3guy’s picture

Ok, so I realized I have a crossdomain.xml at this url: http://talk.mysite.com:7070/crossdomain.xml

So I added a proxy and reverse for that file in my apache2 proxy.conf. This is the stuff I added now:

  <Proxy http://talk.mysite.com:7070/*>
               Order allow,deny
               Allow from all
  </Proxy>

        ProxyPass /http-bind http://talk.mysite.com:7070/http-bind
        ProxyPassReverse /http-bind http://talk.mysite.com:7070/http-bind
        ProxyPass /crossdomain.xml http://talk.mysite.com:7070/crossdomain.xml
        ProxyPassReverse /crossdomain.xml http://talk.mysite.com:7070/crossdomain.xml

Now storphe's crossdomain example does this:

Strophe is connecting.
SENT: <body rid='353657191' xmlns='http://jabber.org/protocol/httpbind' to='test3' 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'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams' authid='86b37864' sid='86b37864' secure='true' requests='2' inactivity='30' polling='5' wait='60' hold='1' ack='353657191' maxpause='300' ver='1.6'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body>
SENT: <body rid='353657192' xmlns='http://jabber.org/protocol/httpbind' sid='86b37864'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/></body>
SENT: <body rid='353657193' xmlns='http://jabber.org/protocol/httpbind' sid='86b37864' to='test3' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams'><stream:features><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body>
SENT: <body rid='353657194' xmlns='http://jabber.org/protocol/httpbind' sid='86b37864'><iq type='set' id='_bind_auth_2' xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq type='result' id='_bind_auth_2' to='talk.mysite.com/86b37864'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>86b37864@talk.mysite.com/86b37864</jid></bind></iq></body>
SENT: <body rid='353657195' xmlns='http://jabber.org/protocol/httpbind' sid='86b37864'><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'><iq type='result' id='_session_auth_2' to='86b37864@talk.mysite.com/86b37864'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
Strophe is connected.
Strophe is disconnecting.
SENT: <body rid='353657196' xmlns='http://jabber.org/protocol/httpbind' sid='86b37864' type='terminate'><presence xmlns='jabber:client' type='unavailable'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'/>
Strophe is disconnected.

Horray, I get a reply (never did before)... I had to use jid of "test3", not "test4@talk.mysite.com". This won't connect everytime though. Sometimes I get:

Strophe is connecting.
SENT: <body rid='3454137162' xmlns='http://jabber.org/protocol/httpbind' to='talk.mysite.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'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams' authid='ef70f6ac' sid='ef70f6ac' secure='true' requests='2' inactivity='30' polling='5' wait='60' hold='1' ack='3454137162' maxpause='300' ver='1.6'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body>
SENT: <body rid='3454137163' xmlns='http://jabber.org/protocol/httpbind' sid='ef70f6ac'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cmVhbG09InRhbGsuYm94eWNpcmNsZS5jb20iLG5vbmNlPSI4eWpZTm5NbXRlQUQzVjFYTDlycUpSYURxUmJRbkczcXIyTTJOc3o1Iixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge></body>
Strophe failed to connect.
Strophe is disconnected.

Also, I noticed I can not connect to the server with pidgin using accounts that were created by drupal. In my xmpp server logs I get: "User Login Failed. PLAIN authentication failed". Though it looks like I can connect to those accounts with strophe's crossdomain.html.

One thing to note... in crossdomain.js I had to have a '/' slash on the end, like so "http://talk.mysite.com/http-bind/".... Is this also the case in admin/settings/dxmpp?

I'm almost there! Strophe looks like it can connect, but drupal still cant... not sure why.

that0n3guy’s picture

Ok, I think strophe isn't really connecting.. I put in a completely wrong password into crossdomain.html and it still acted like it connected (like the first example above).

When I try a true jid (like: test39@talk.mysite.com.com), I get this:

Strophe is connecting.
SENT: <body rid='679601257' xmlns='http://jabber.org/protocol/httpbind' to='talk.mysite.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'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams' authid='f03a2f4a' sid='f03a2f4a' secure='true' requests='2' inactivity='30' polling='5' wait='60' hold='1' ack='679601257' maxpause='300' ver='1.6'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body>
SENT: <body rid='679601258' xmlns='http://jabber.org/protocol/httpbind' sid='f03a2f4a'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cmVhbG09InRhbGsuYm94eWNpcmNsZS5jb20iLG5vbmNlPSJldlprbFBaaTBlazVueVpDUDRwaExjMjJKb2ZFVkJKM2xHZkpzczJRIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge></body>
Strophe failed to connect.
Strophe is disconnected.