Re: Chapter 3 - hello - a few n00bie problems, hope someone can help!

34 views
Skip to first unread message
Message has been deleted

Jack Moffitt

unread,
Oct 2, 2012, 4:27:57 PM10/2/12
to str...@googlegroups.com
> i tried to create a new account using both pidgin and psi at
> bosh.metajack.im, but it wasn't having it; p1.im is offering accounts, so i
> set one up there.

bosh.metajack.im is not an XMPP server; it's just a BOSH endpoint. You
must tell it what XMPP server you wish to connect to. It's what I call
a "stand-alone BOSH service"
(http://metajack.im/2008/09/08/which-bosh-server-do-you-need/)

> i've tried at least a zillion different ways to connect to im server
> dinah.p1.im.
>
> i'm testing chapter 3's "hello" setup with only a few modifications:
> a) in hello.js, i changed the bosh.metajack.im server address to:
> var conn = new
> Strophe.Connection("http://dinah.p1.im:5222/xmpp-httpbind");

I don't think that's a valid BOSH endpoint. Port 5222 is the XMPP TCP
port, which Strophe.js will be unable to use. You can continue to use
bosh.metajack.im for connecting to dinah.p1.im. It will know what XMPP
server to contact based on your JID.

It looks like URL for bosh on p1.im is: http://dinah.p1.im:5280/http-bind

> b) in hello.html, i changed the <script>'s to load from my libraries;
> c) i d/l'ed and created strophe.xdomainrequest.js (it gets loaded); and

Unless you're in IE, you don't need this. It's probably best to test
without this or the strophe.flxhr.js plugin, and worry about making
things work for IE later.

> d) in .htaccess, i added Header set Access-Control-Allow-Origin *.

This .htaccess stuff has to be done on the server that you connect to,
which means whatever URL you gave to Connection(). Since you don't
control that server, you have no way to support XHR if they don't
already do so.

> when i run wroxHello.html (renamed to avoid conflicts), i get a js error;
> firebug shows me this:
>
> 11, flXHR::open(): Failed, The open() call failed to complete.
> http://(test site name)/js/flXHR.js

Try without flXHR. But the reason thsi fails is that it's not making
an HTTP connect, but getting an XMPP connection on the other end, so
of course it can't connect. Also, Flash security policy will not allow
such a connection if the file http://dinah.p1.im:5222/crossdomain.xml
does not exist or does not allow connections from whatever URL your
app is at.

> also, Jack, we pay real well when it comes to consulting - if you're
> available, please lmk! dinahmight at gmail dot com

Feel free to contact me privately for such things.

jack.
Reply all
Reply to author
Forward
0 new messages