Ejabberd
Posted: 12 April 2007 09:50 AM   [ Ignore ]
Newbie
Rank
Total Posts:  5
Joined  2007-04-12

Hi,

I begin with ejabberd and i need to make a web client based on AJAX and DOJO.
I want to know if it’s possible or not for a client to make get or post requests on ejabberd and that the ejabberd answer in JSON ?
I know that i need to write some ejabberd modules to do that but, is it possible to do such a thing?

Maybe i could use another solution but the problem is that the client could not parse easily XMPP. So i may use a servlet which communicate with the client (client-> servlet: post | servlet -> client:JSON) and which listen to the server, using SMACK api, but is it a good way?

Sorry for my poor english :-s , i hope you understand my problem and i thank you to tell me all ideas you could have on that topic.

Profile
 
 
Posted: 13 April 2007 05:31 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  3
Joined  2007-04-13

What is the purpose of the web client ?

Profile
 
 
Posted: 13 April 2007 08:15 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  5
Joined  2007-04-12

Sorry, i forgot to say that’s for instant messaging.
tongue rolleye

Profile
 
 
Posted: 13 April 2007 09:58 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  169
Joined  2006-11-12

Yes, this kind of module can be done. We have done that already in the past.

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 13 April 2007 10:03 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  5
Joined  2007-04-12

Ok, great. Is this method scalable? Could you indicate how to do such a module or where can i find it ?

Thanks.

Profile
 
 
Posted: 23 April 2007 08:41 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  169
Joined  2006-11-12

Yes, this approach is very scalable.
I think however that there is no public module that is close to what you are trying to achieve.

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 23 April 2007 01:17 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  5
Joined  2007-04-12

ok, thank you .
I tried to connect a javascript web client with httpbinding at http://server:5280/http-bind but the service is unavailable. I’m not sure but maybe it’s a problem of files versions but i don’t manage to use mod_http_binding, or maybe it’s a problem with the requests handlers cause i don’t manage to use the mod_hello in the example.

I have an other question cause i can’t connect with http-polling under firefox.

[Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: file:///..jsjac/clientJabber/JSJaCHttpPollingConnection.js :: JSJaCHPCConnect :: line 203" data: no]

It seems to be a problem of XMlHttpRequest permission but i don’t understand. Do i have to use a proxy to do http-polling or can i connect my web client and my ejabberd server without proxy?

Thanks for your help.

Nicolas

Profile
 
 
Posted: 26 April 2007 02:25 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  169
Joined  2006-11-12

Hello,

you need to serve the Javascript from the same domain you are doing the polling. On the current stable ejabberd it means that you have to use a proxy.

In the next release, you will be able to host your Javascript directly in ejabberd, mainly for ease of use and performance improvements reasons.

 Signature 

Mickaël Rémond
ProcessOne

Profile