Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Professional XMPP Programming with JavaScript and jQuery
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XMPP Programming with JavaScript and jQuery
This is the forum to discuss the Wrox book Professional XMPP Programming with JavaScript and jQuery by Jack Moffitt; ISBN: 978-0-470-54071-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 20th, 2013, 11:36 AM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default 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

Last edited by upside; March 20th, 2013 at 11:40 AM.. Reason: providing the URLs to my test pages
  #2 (permalink)  
Old March 20th, 2013, 11:43 AM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

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).
The Following User Says Thank You to metajack For This Useful Post:
upside (March 20th, 2013)
  #3 (permalink)  
Old March 20th, 2013, 12:00 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default 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
  #4 (permalink)  
Old March 20th, 2013, 12:04 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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.
  #5 (permalink)  
Old March 20th, 2013, 12:08 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

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).
The Following User Says Thank You to metajack For This Useful Post:
upside (March 20th, 2013)
  #6 (permalink)  
Old March 20th, 2013, 12:12 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default 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!!!!
  #7 (permalink)  
Old March 20th, 2013, 12:27 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

You're very welcome. Enjoy!
The Following User Says Thank You to metajack For This Useful Post:
upside (March 20th, 2013)
  #8 (permalink)  
Old March 20th, 2013, 12:44 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
finding free book "Beginning Jsp Book" ruzdi JSP Basics 0 December 7th, 2007 01:46 PM
Combo box select affecting avail option in another ebburks Access 4 June 3rd, 2006 05:33 PM
Help,I can't find my book in your book list. 5uer All Other Wrox Books 2 August 21st, 2004 12:43 AM
I can't find my book in your book list. duxn_79 All Other Wrox Books 2 July 13th, 2004 01:58 AM



All times are GMT -4. The time now is 01:06 AM.


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