p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional XMPP Programming with JavaScript and jQuery (http://p2p.wrox.com/forumdisplay.php?f=542)
-   -   SINCERELY looking for help ... followed book to no avail (http://p2p.wrox.com/showthread.php?t=89646)

upside March 20th, 2013 11:36 AM

SINCERELY looking for help ... followed book to no avail
 
Hello — desperately looking for help — any advice greatly appreciated

Purchased the book, excellent.

I have tried the book helloworld example code and now attempting to get strophe example working to no avail ...

I have a server running CENTOS 5.8 with OPENFIRE 3.8.1 installed up running and tested connect via SPARK, OK and working.

HTTP Bind settings are enabled on port 7070
Script Syntax is enabled
CORS is enabled

in apache conf i have set the following up for proxy:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

<IfModule mod_proxy.c>
ProxyRequests Off
ProxyTimeout 1000
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /jabber/ http://localhost:7070/http-bind/
ProxyPassReverse /jabber/ http://localhost:7070/http-bind/

At the WWW ROOT of my server that has Openfire installed and running — in 'httpdocs' i have placed a copy of the crossdomain.xml file

I tried the example code locally on the server and it did not work

On a different server at another domain ... i have attempted to test the crossdomain.html strophe example (mod'd to connect to my server and also included the Flash fallback) to attempt to test a connect to my server as follows:
var BOSH_SERVICE = 'http://216.70.111.248/jabber/'

upon entering the JID and Pass i get the following error in the console:
Failed to load resource: the server responded with a status of 500 (Server Error)

Any help here greatly appreciated.
I have tried MANY various proxy settings to no avail.

FEEL FREE to hit my server to test a connection to it ... ill provide the username / password and URL here:

Server:
http://216.70.111.248
You can see Openfire BOSH at http://216.70.111.248:7070

My test pages:
local on same server as openfire: http://216.70.111.248/strophe/examples/crossdomain.html
remote server: http://disrupt.nu/strophe/examples/crossdomain.html

Available user:
JID: test
Pass: test123

MY GOAL is to get a strophe example connecting to my Openfire server via HTTP correctly over BOSH

Again — any advice or help sincerely appreciated

metajack March 20th, 2013 11:43 AM

If CORS is enabled, you can set the bosh service ot Openfire directly. There is no need to use the apache proxy.

You should remove the flxhr plugin if you are using that. It is not needed with an Apache proxy.

I'll need more information in order to help you further. See chapter 4 about how to get error logs, and post the logs here. It would also be useful to see the entire HTTP request that causes the 500 error as well, which you can get from your browser's network inspector panel (Firefox or Chrome).

upside March 20th, 2013 12:00 PM

Update ...
 
Ok ... first — THANK YOU for that quick reply!

I understand what you are saying — ultimately i do want to eliminate all need for the FLASH fallback — end product will run on mobile devices — so i do need the Proxy setup to work

Heres an update:
without changing anything — i restarted the server

... and now may be seeing appropriate responses?

Please see: http://disrupt.nu/strophe/examples/crossdomain.html
username: test
pass: test123

That seem correct to you now? I have not had chance to dig in further wanted to reply while you were available — im researching as we speak

upside March 20th, 2013 12:04 PM

using the crossdomain test from strophe package — it is outputting following at an attempt to connect REGARDLESS wether user/pass is correct or not:

Strophe is connecting.
SENT: <body rid='2170255482' xmlns='http://jabber.org/protocol/httpbind' to='doesnotexist' 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='a5bebf8f' sid='a5bebf8f' secure='true' requests='2' inactivity='30' polling='5' wait='60' hold='1' ack='2170255482' 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='2170255483' xmlns='http://jabber.org/protocol/httpbind' sid='a5bebf8f'><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='2170255484' xmlns='http://jabber.org/protocol/httpbind' sid='a5bebf8f' to='doesnotexist' 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='2170255485' xmlns='http://jabber.org/protocol/httpbind' sid='a5bebf8f'><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 xmlns='jabber:client' type='result' id='_bind_auth_2' to='groop.nu/a5bebf8f'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>a5bebf8f@groop.nu/a5bebf8f</jid></bind></iq></body>
SENT: <body rid='2170255486' xmlns='http://jabber.org/protocol/httpbind' sid='a5bebf8f'><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 xmlns='jabber:client' type='result' id='_session_auth_2' to='a5bebf8f@groop.nu/a5bebf8f'/></body>
Strophe is connected.
Strophe is disconnecting.
SENT: <body rid='2170255487' xmlns='http://jabber.org/protocol/httpbind' sid='a5bebf8f' type='terminate'><presence xmlns='jabber:client' type='unavailable'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate'/>
Strophe is disconnected.

metajack March 20th, 2013 12:08 PM

That all looks correct now.

The reason that you get an anonymous jid is that the username must be a bare or full jid. If you don't have an @ sign in the username, it assumes it's just a domain and asks for an anonymous JID.

try test@groop.nu (or whatever your server is named).

upside March 20th, 2013 12:12 PM

HUGE THANKS!!!!!!
 
OK I can NOT explain how HAPPY i am to see this working!!!!! Your book was inspiring — sincere thanks for your patience with me i am a new-B — cannot wait now to dive all the way in

THANK YOU SIR!!!!

metajack March 20th, 2013 12:27 PM

You're very welcome. Enjoy!

upside March 20th, 2013 12:44 PM

Just thought id add to this thread for anyone else digging ...
the examples in the book are all now working as well as a result ...

After setting my proxy up in the httpd config .... i of course restarted apache .... but for whatever reason .... i needed to reboot the entire server to get it working ... im assuming that had something to do with my ISP

hope any and all other developers find this thread to be useful

unfortunately i will be taking down the links mentioned in my first post for obvious reasons ;)

All the best,
Mike


All times are GMT -4. The time now is 03:21 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.