Comments (21)
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.
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!!
MarkReply to this email directly or view it on GitHub:
#11
from jsjac.
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:
Hope this helps,
Andrea
from jsjac.
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.
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:
Something about the authtype it doesn't like - I wanna use the X-FACEBOOK-PLATFORM type...
from jsjac.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
sir simply tell me how i can use JSJaC facebook chat client to my website?
from jsjac.
Related Issues (20)
- unable to use JsJaC facebook chat client library to my web site ........ i read the read me in the JSJAC but have no idea about how to implement this client library in my website..... and how i can use this link to utilize bosh server "https://jappix.com HOT 4
- Unable to connect to OpenFire HOT 16
- Support method chaining for registerHandler
- get roster presence HOT 2
- jsjac simpleclient android app ( via phonegap ) , doesn't support websocket HOT 5
- XEPs and RFCs support page with version HOT 5
- Handle WebSocket stream termination HOT 1
- ondisconnect not being triggered HOT 1
- Latest release HOT 1
- 503 error HOT 1
- Send 'away' status on before unload event HOT 6
- In firefox doesn`t work adding users to roster. HOT 11
- Websockets Prebound session HOT 2
- Possible to not use cookie? HOT 2
- BOSH over websocket not work. HOT 2
- in Chrom v56.0.2924.87 (正式版本) (32 位) XMLHTTPReaust error HOT 1
- How to implement XEP-0163 PEP function in jsjac? HOT 6
- XMPP Core HOT 2
- Synchronous XMLHttpRequest on the main thread is deprecated
- Support XEP-0184: Message Delivery Receipts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsjac.