Chat in a dating website - need help & suggestions

Hi everyone,

I have a dating webstie I will improve with a better chat funcitonnality very soon. I already have a wildfire server for it but would like to have different point of view than mine about how to handle all the chat process in the website. I am ready to put everythng in the trash and rewrite all the necessary code to have a clean chat client that works fine!

So the architecture is quite clear and easy: Wildfire as the chat server + PHP + MySQL + tons of AJAX

I need the max ideas and suggestions about how to write the chat client, what to use for (may be XIFF but the support seems a bit poor)

Is there any Javascript-based code to deal with a Wildifre Server ? Any PHP classes or frameworks maybe …

Any idea is welcome!

Thanks in advance for your help!

some links

http://jwchat.sourceforge.net/

I recommend JwChat. I tried using a PHP jabber bot, but that didn’t work out (as a *nix daemon, it kept silently crashing).

There is a new version of JSJAC out (java script library for XMPP communication), so you will need to adapt JwChat to that and to your needs. But it’s really not too hard, it has a debugger that helps alot

JSJAC: http://zeank.in-berlin.de/jsjac/

JwChat vcs: http://jwchat.sourceforge.net/download.shtml

thanks for your replies guys

Can JwChat wok with any jabber server ? (openfire & wildfire for eg.)

http://jwchat.sourceforge.net/features.shtml

Backends for communication

JWChat relies on some service either implementing HTTP Polling or HTTP Binding (through the use of JSJaC).

There a Jabber™ servers out there having such kind of services built-in directly like ejabberd that comes with an http polling interface. If your server doesn’t support any of these protocols itself there are external software components available which let you connect to any jabber server using HTTP Polling or HTTP Binding like punjab or JabberHTTPBind.

Openfire does support HTTP Binding, but I have never tried it.

I don’t even know the difference … I have wildifre with its default params

I’ve tried that Javascript class, it asks for the “HTTP base” … what is it ?

With JwChat, you will need to use either HTTPBinding (now called BOSH) or HTTPPolling (getting old).

The creator of JwChat has also created a HTTPBinding servlet, which you will need when using Wildfore (Openfire now has HTTPBinding incorporated).

Jabber HTTPBinding Servlet: http://zeank.in-berlin.de/jhb/

You will need a servlet container like Apache Tomcat to use it. Just set it up as per default and put the servlet in the webapps folder.

Tomcat: http://tomcat.apache.org/

Then you need to set up your webserver to do the proxying of JwChats requests. See the tutorial below. If using Wildfire + Tomcat, you need to point the proxy redirect to the /JHB/ in tomcat. Not really much difference, once it’s set up.

The HTTP_base is the address appendix in your webserver that will redirct to the BOSH service, for example “/JHB/”

There is also a tutorial to set up JwChat with Openfire:

http://chromus.kajigger.com/blog/2007/03/22/making-jwchat-work-with-openfire/

If using Openfire, read the gotcha in this blog entry:

http://zeank.in-berlin.de/2007/08/31/jsjac-v10-is-out/

Important note for OpenFire users:

In order to make JSJaC work with OpenFire please edit src/JSJaCHttpBindingConnection.js and set JSJACHBC_USE_BOSH_VER to false. Don’t forget to update jsjac.js by issuing a make build afterwards if you want to use the single include file.

Additionally you may have to make sure that JSJaC uses NON SASL authentication. To do this make sure to pass the property authtype=’nonsasl’ to your call to connect. E.g.

> oArgs.domain = 'example.org';
> oArgs.username = 'romeo';
> oArgs.resource = 'jsjac_simpleclient';
> oArgs.pass = 'topSecret';
> oArgs.authtype = 'nonsasl';
> con.connect(oArgs);

thanks a lot for these tips.

I think I will move to Openfire to get that built-in servlet, but, I don’t remember if the guy who installed & configured our server did install tomcat, is that really necessary ? all he did is installing Wildfire which runs as JSP scripts (by Apache may be) … I am a bit confused about all this, sorry.

Is choosing HTTPPolling in JwChat requires an HTTP-base value ? I guess my server now runs that way, since we’ve nerver configured that servlet …

So back to the best solution, do you think JsJac is reliable ? I see a lot of websites use Web-based clients (meebo, web messenger…), so are those based on the same kind of javascript frameworks ? how do they compare to a flash based solution ?

hbr wrote:

thanks a lot for these tips.

I think I will move to Openfire to get that built-in servlet, but, I don’t remember if the guy who installed & configured our server did install tomcat, is that really necessary ? all he did is installing Wildfire which runs as JSP scripts (by Apache may be) … I am a bit confused about all this, sorry.

Wildfire as JSP? Not likely. Maybe as a WAR (servlet), but then, yes, you have Tomcat (or a similar servlet container)…

Is choosing HTTPPolling in JwChat requires an HTTP-base value ? I guess my server now runs that way, since we’ve nerver configured that servlet …

No, I don’t think that that is dependent on which way you chose. The base is “the address you point your web-based clients to”, for example, you want them to connect to Free classifieds - yourdomain.com. Then you put “/chat/” as your http base and configure the proxyPass in Apache acordingly.

Edit: I don’t think Wildfire supports HTTP polling. You’ll always need the servlet.

So back to the best solution, do you think JsJac is reliable ? I see a lot of websites use Web-based clients (meebo, web messenger…), so are those based on the same kind of javascript frameworks ? how do they compare to a flash based solution ?

Once you get it to run, it works fine. It has some problems working in Safari, I think. It’s just a bit fiddly to adapt JwChat (we split alot of javascript out of html pages, and we also did away the mulit language option)…

Hi,

I recently implemented Openfire with JWChat and it works fine.

Openfire support HTTP Binding. You need to add some properties on Openfire server. Also, if you are using linux, there is a particular folder missing on Openfire server. You will need to add that manually.

Regards,

Nitin

Hey Nitin,

Could you give us more information about the missing folder? I would like to fix that issue. Are you using Openfire 3.3.3?

Thanks,

– Gato

HI Gato,

I found that folder <Install_Dir>/resources/spank was missing when we installed on linux using rpm. When I copied the same from my windows install, http binding worked fine.

I am using 3.3.2. I didn’t upgrade to 3.3.3 as I did POC on 3.3.2 and there was no fix which affected my implementation.

Gato, do you work for Openfire?

Thanks

Nitin

I got openfire and jwchat but there is few bugs:

  • problem with msn transport - you cant chat with msn contact

  • chatrooms problem. Most important: search chatroom not working. Return no results on my server.