How can I use the http binding with smack3.0.4 and openfire

Hi.

I am going to use http binding to my project. I see a lot of documents and source codes with smack and openfire.but I don’t know how smack support http binding still now.Can you give me a sample.

Thanks

You can not. smack is a XMPP client library, HTTP binding uses AJAX (JavaScript) to communicate.

A smack client will connect directly to a XMPP port (usually 5222), the HTTP binding is about being able to use a browser to use XMPP over HTTP.

Look into JWChat or Red5.

In fact is a missing feature of Smack. HTTP Binding has nothing to do with AJAX, although it is usually used by javascript-based XMPP clients.

A XMPP client is only required to support the XML-stream as defined in the RFC. HTTP Binding is an optional XEP.

For instance, I used Pidgin to connect to GoogleTalk, because at work, I’m behind a HTTP proxy, and XMPP connections are not allowed.

Google Talk (and few other public servers) offers HTTP Binding. Thanks to it, I can use Pidgin but I can’t use Spark (for instance) to connect to GTalk, nor use our OpenFire as a gateway to GTalk.

So, HTTP Binding is the solution for those in a firewalled network with only HTTP proxies.

I have been hoping for HTTP Binding support in Smack for a while now, but last I checked Jive is currently only interested in using that in the web client. It is currently the most popular issue in Smack and you can add your vote for it here: SMACK-187

Chris