Giter Club home page Giter Club logo

Comments (21)

zzo avatar zzo commented on July 30, 2024

Ah the XML didn't post here is the request from JSJaC:

<body content='text/xml; charset=utf-8' hold='1' xmlns='http://jabber.org/protocol/httpbind' to='undefined' wait='300' rid='584609' route='xmpp:chat.facebook.com:5222' secure='false' newkey='9972e987137ee3ba9da8bbd5b6c5fdc4e309f143' xml:lang='en' ver='1.6' xmlns:xmpp='urn:xmpp:xbosh'/>

and the response from I think node-xmpp-bosh:

<body xmlns="http://jabber.org/protocol/httpbind" condition="item-not-found" message="Invalid session ID" type="terminate"/>

from jsjac.

sstrigler avatar sstrigler commented on July 30, 2024

Hi!

Sorry but I'm not into this FB Chat thing. I know that you can connect to FB using standard xmpp login methods but I don't know about this token auth. This patch has been added by someone else. So better ask him about things related to this option.

To me it looks like you forgot to set the 'domain' parameter as within the first request you can see the 'to' parameter being set to 'undefined' which is most likely not what you want. Probably it should be set to sth like 'chat.facebook.com' or 'facebook.com'.

Hope this helps, Steve

Am 11.06.2011 um 03:25 schrieb zzo:

Howdy - I'm using JSJaC clone'd from git earlier today.
Am trying to add Facebook chat to my website.
I'm using node-xmpp-bosh as the bosh server.
I'm using NodeJS which is proxy'ing requests to node-xmpp-bosh.

So I loaded up your facebook example - I have a 'forever' access token so am not using any of your FB JS stuff - I just return my forever token from the getSession method in the FBConnection class (which is misspelled in the man JSJac class FWIW).

ANYWAYS so when I try to chat JSJaC is POST'ing to my endpoint:

I proxy this over to node-xmpp-bosh running on localhost:5280 & it returns:

Immediately - I don't think it's going to chat.facebook.com:5222.

SO... what am I doing wrong? Granted I have a very tenuous grasp of XMPP+BOSH...

thank you!!
Mark

Reply to this email directly or view it on GitHub:
#11

from jsjac.

raindrop80 avatar raindrop80 commented on July 30, 2024

Hi!
The main problem I see it's that maybe your Node.js is not able to correctly redirect the request to Facebook domain.
I suggest you to test it with JabberHTTPBind running on a Tomcat server. You can find more on this servlet at the following address:

http://blog.jwchat.org/jhb/

Hope this helps,
Andrea

from jsjac.

 avatar commented on July 30, 2024

Hi,

We are using node-xmpp-bosh on https://bind.jappix.com/ to run https://www.jappix.com/ - Jappix uses JSJaC - and it works well with the Facebook Chat server.

Anyway, I think the "route" attribute (when connecting) have to be removed in JSJaC, since the DNS SRV records replace it. The solution would be not to include it each time, just when a specific host & port is defined.

from jsjac.

zzo avatar zzo commented on July 30, 2024

thanks all I'm getting closer:
I specified 'sasl' in the 'authtype' parameter to the JSJaCHttpBindingConnection constructor & then in JSJaCHttpBindingConnection I set this.authtype to oArgs.authtype so the 'sasl' block gets executed when building the request.
So now I'm getting a much bigger chunk back from FB servers (had to tell node-xmpp-bosh to NOT use TLS for chat.facebook.com).
I ALSO had to set:
this.authhost this.host = oArg.host || this.domain;
in JSJaCConnection as that sets the 'to' attribute in the XML......

SO anyways here's a dump of what I'm getting from node-xmpp-bosh:

http://pastebin.com/R2ajhFL3

Something about the authtype it doesn't like - I wanna use the X-FACEBOOK-PLATFORM type...

from jsjac.

 avatar commented on July 30, 2024

And if you set oArgs.secure = true in the connect function? I had no problem using JSJaC + node-xmpp-bosh + Facebook Chat with this configuration!

from jsjac.

zzo avatar zzo commented on July 30, 2024

thanks I just set secure to true & got the same result....

how are you proxying the connection to node-xmpp-bosh from JSJaC? My web page containing the JS is server from another port than 5280 so I gotta proxy JSJaC's connections thru my nodejs-based server over to node-xmpp-bosh...

from jsjac.

zzo avatar zzo commented on July 30, 2024

Seems like the problem is around JSJaC sending:

<body rid='337932' sid='719e661e-5ba6-4ee3-a871-93250ad77b99' xmlns='http://jabber.org/protocol/httpbind' key='509f02c8259462c986a6ac05d62ba3564964d148' ><iq xmlns="jabber:client" type="get" id="auth1"><query xmlns="jabber:iq:auth"><username/></query></iq>

As later on FB responds with:

<iq from="chat.facebook.com" id="auth1" type="error"><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

and then it's done...

from jsjac.

raindrop80 avatar raindrop80 commented on July 30, 2024

Hi guys.
Did you saw the Facebook example I developed in the samples folder?
I think that the problems you are having is coming from your xmpp-bosh.
If it can help you I can setup a working online demo to let you show how it works.

Let me know..

from jsjac.

 avatar commented on July 30, 2024

zzo, we are proxying to https://bind.jappix.com/ for Jappix Mini, and https://www.jappix.com/bind for the full Jappix, so no-cross-domain browsers can work with it.

from jsjac.

zzo avatar zzo commented on July 30, 2024

right duh.

OMG I GOT IT WORKING!!! Unclear how it ever worked before actually.

I've forked this with my changes (not very many) here:

https://github.com/zzo/JSJaC

Please review - I'll issued a pull request -thanks!! Mark

The diffs & my comments on the diffs are here:

zzo@49b3432#commitcomment-426575

THANKS!!

from jsjac.

zzo avatar zzo commented on July 30, 2024

BTW my changes should NOT effect any other XMPP action - just FB.

I -think- the ONLY line that may effect other XMPP action is this:

  • this.authhost = this.host = oArg.host || this.domain;

Maybe it should be:
this.host = oArg.host || this.domain;
if (!this.authhost) this.authhost = this.host;

??

in Connection.js ... thanks! Mark

from jsjac.

zzo avatar zzo commented on July 30, 2024

So for grins my setup is:

Webpage -> my connect-based NodeJS webserver (which serves the JS & the rest of my app) -> proxied to -> node-xmpp-bosh -> chat.facebook.com - and back.

So my users can magically be on any page on the web & FB chatting - just what everyone always wanted... Crazy thing actually works.

from jsjac.

raindrop80 avatar raindrop80 commented on July 30, 2024

That's the main reason why I developed and shared the X-FACEBOOK-PLATFORM auth method.
I already developed four projects using it and they all works really great.

from jsjac.

mirzaarsalan avatar mirzaarsalan commented on July 30, 2024

plz help me i wanna connect to my website with fb chat but i cannot configure this JAJaC ????????
whhen ever i run jsjac.js file on node.js it return an error in the line
var scripts = document.getElementsByTagName("script");

from jsjac.

rraptorr avatar rraptorr commented on July 30, 2024

JSJaC is a client side JavaScript library, it is supposed to be run in a browser and allows one to build IM in a browser. It will not run on your nodejs server and will not allow you to connect your server to Facebook chat.

from jsjac.

mirzaarsalan avatar mirzaarsalan commented on July 30, 2024

sir plz guide me how is run this build IM in the browser whenever i run this i got this error
Uncaught ReferenceError: JsJaCFBApplication is not defined
how i configure this client side library ?????? help me or send me running code with complete configuration plzzzzzzzz

from jsjac.

mirzaarsalan avatar mirzaarsalan commented on July 30, 2024

and whenever i configure fb app it give me just 2 things app id and App Secret: not api key hows i get this??????

from jsjac.

mirzaarsalan avatar mirzaarsalan commented on July 30, 2024

Uncaught ReferenceError: FB is not defined ...............whenever i connect jsjac client to facebook chat server using HTTP Base (https://jappix.com/bind/fbchat) and other parameters as app id and secerte key................ plz tell me where is problem ...... and tell me how to connect my jsjac fb chat client to this xmpp-bosh server ( https://bind.jappix.com/ ) plz reply me as soon as possible ???????????????????????????

from jsjac.

rraptorr avatar rraptorr commented on July 30, 2024

Honestly, I have completely no idea what are you trying to do so I cannot help you. If you do have some problems please create a new issue, with detailed description of the problem and sample of the code you are having trouble with.

And please do use smaller amount of question marks, we really can see a single one;)

from jsjac.

mirzaarsalan avatar mirzaarsalan commented on July 30, 2024

sir simply tell me how i can use JSJaC facebook chat client to my website?

from jsjac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.